comparison src/protocols/oscar/family_feedbag.c @ 13901:e40263ba9680

[gaim-migrate @ 16388] When moving a buddy on AIM, remove the buddy from the server list before adding it to the new group (it used to be the other way around). The downside of this is that, if you're moving an ICQ buddy who requires authorization, you'll have to rerequest authorization. The upside of this is that it actually works, and moving an ICQ buddy won't inadvertently delete them from your list. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sat, 01 Jul 2006 18:39:13 +0000
parents 2bac009eaa0c
children
comparison
equal deleted inserted replaced
13900:47c3d00713af 13901:e40263ba9680
454 * @param list A pointer to the current list of items. 454 * @param list A pointer to the current list of items.
455 * @param gn The group of the buddy. 455 * @param gn The group of the buddy.
456 * @param sn The name of the buddy. 456 * @param sn The name of the buddy.
457 * @return 1 if you are waiting for authorization; 0 if you are not 457 * @return 1 if you are waiting for authorization; 0 if you are not
458 */ 458 */
459 int aim_ssi_waitingforauth(struct aim_ssi_item *list, const char *gn, const char *sn) 459 gboolean aim_ssi_waitingforauth(struct aim_ssi_item *list, const char *gn, const char *sn)
460 { 460 {
461 struct aim_ssi_item *cur = aim_ssi_itemlist_finditem(list, gn, sn, AIM_SSI_TYPE_BUDDY); 461 struct aim_ssi_item *cur = aim_ssi_itemlist_finditem(list, gn, sn, AIM_SSI_TYPE_BUDDY);
462 if (cur) { 462 if (cur) {
463 if (aim_tlv_gettlv(cur->data, 0x0066, 1)) 463 if (aim_tlv_gettlv(cur->data, 0x0066, 1))
464 return 1; 464 return TRUE;
465 } 465 }
466 return 0; 466 return FALSE;
467 } 467 }
468 468
469 /** 469 /**
470 * If there are changes, then create temporary items and 470 * If there are changes, then create temporary items and
471 * call addmoddel. 471 * call addmoddel.
943 * @param sn The name of the buddy to be moved. 943 * @param sn The name of the buddy to be moved.
944 * @return Return 0 if no errors, otherwise return the error number. 944 * @return Return 0 if no errors, otherwise return the error number.
945 */ 945 */
946 int aim_ssi_movebuddy(OscarData *od, const char *oldgn, const char *newgn, const char *sn) 946 int aim_ssi_movebuddy(OscarData *od, const char *oldgn, const char *newgn, const char *sn)
947 { 947 {
948 char *alias = aim_ssi_getalias(od->ssi.local, oldgn, sn); 948 char *alias;
949 aim_ssi_addbuddy(od, sn, newgn, alias, NULL, NULL, aim_ssi_waitingforauth(od->ssi.local, oldgn, sn)); 949 gboolean waitingforauth;
950
951 alias = aim_ssi_getalias(od->ssi.local, oldgn, sn);
952 waitingforauth = aim_ssi_waitingforauth(od->ssi.local, oldgn, sn);
953
950 aim_ssi_delbuddy(od, sn, oldgn); 954 aim_ssi_delbuddy(od, sn, oldgn);
955 aim_ssi_addbuddy(od, sn, newgn, alias, NULL, NULL, waitingforauth);
956
951 free(alias); 957 free(alias);
958
952 return 0; 959 return 0;
953 } 960 }
954 961
955 /** 962 /**
956 * Change the alias stored on the server for a given buddy. 963 * Change the alias stored on the server for a given buddy.