changeset 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 47c3d00713af
children 425e0f861e88
files src/protocols/oscar/family_feedbag.c src/protocols/oscar/oscar.h
diffstat 2 files changed, 13 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/oscar/family_feedbag.c	Sat Jul 01 18:04:55 2006 +0000
+++ b/src/protocols/oscar/family_feedbag.c	Sat Jul 01 18:39:13 2006 +0000
@@ -456,14 +456,14 @@
  * @param sn The name of the buddy.
  * @return 1 if you are waiting for authorization; 0 if you are not
  */
-int aim_ssi_waitingforauth(struct aim_ssi_item *list, const char *gn, const char *sn)
+gboolean aim_ssi_waitingforauth(struct aim_ssi_item *list, const char *gn, const char *sn)
 {
 	struct aim_ssi_item *cur = aim_ssi_itemlist_finditem(list, gn, sn, AIM_SSI_TYPE_BUDDY);
 	if (cur) {
 		if (aim_tlv_gettlv(cur->data, 0x0066, 1))
-			return 1;
+			return TRUE;
 	}
-	return 0;
+	return FALSE;
 }
 
 /**
@@ -945,10 +945,17 @@
  */
 int aim_ssi_movebuddy(OscarData *od, const char *oldgn, const char *newgn, const char *sn)
 {
-	char *alias = aim_ssi_getalias(od->ssi.local, oldgn, sn);
-	aim_ssi_addbuddy(od, sn, newgn, alias, NULL, NULL, aim_ssi_waitingforauth(od->ssi.local, oldgn, sn));
+	char *alias;
+	gboolean waitingforauth;
+
+	alias = aim_ssi_getalias(od->ssi.local, oldgn, sn);
+	waitingforauth = aim_ssi_waitingforauth(od->ssi.local, oldgn, sn);
+
 	aim_ssi_delbuddy(od, sn, oldgn);
+	aim_ssi_addbuddy(od, sn, newgn, alias, NULL, NULL, waitingforauth);
+
 	free(alias);
+
 	return 0;
 }
 
--- a/src/protocols/oscar/oscar.h	Sat Jul 01 18:04:55 2006 +0000
+++ b/src/protocols/oscar/oscar.h	Sat Jul 01 18:39:13 2006 +0000
@@ -1144,7 +1144,7 @@
 guint32 aim_ssi_getpresence(struct aim_ssi_item *list);
 char *aim_ssi_getalias(struct aim_ssi_item *list, const char *gn, const char *sn);
 char *aim_ssi_getcomment(struct aim_ssi_item *list, const char *gn, const char *sn);
-int aim_ssi_waitingforauth(struct aim_ssi_item *list, const char *gn, const char *sn);
+gboolean aim_ssi_waitingforauth(struct aim_ssi_item *list, const char *gn, const char *sn);
 
 /* Client functions for changing SSI data */
 int aim_ssi_addbuddy(OscarData *od, const char *name, const char *group, const char *alias, const char *comment, const char *smsnum, int needauth);