changeset 19649:c6f1f9971c4a

When doing oscar server-side list management, do deletions before additions because if it's done the other way then it's possible for Pidgin to try to add one buddy to two different groups, which isn't allowed for ICQ. Fixes schoen's comment at http://developer.pidgin.im/ticket/576 References #576.
author Mark Doliner <mark@kingant.net>
date Wed, 05 Sep 2007 05:43:08 +0000
parents 450f4a3c4c0f
children 2604ae7c227b
files libpurple/protocols/oscar/family_feedbag.c
diffstat 1 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/oscar/family_feedbag.c	Wed Sep 05 01:12:44 2007 +0000
+++ b/libpurple/protocols/oscar/family_feedbag.c	Wed Sep 05 05:43:08 2007 +0000
@@ -505,13 +505,13 @@
 	 * buddy ID#s, which makes things more efficient.  I think.
 	 */
 
-	/* Additions */
+	/* Deletions */
 	if (!od->ssi.pending) {
-		for (cur1=od->ssi.local; cur1 && (n < 15); cur1=cur1->next) {
-			if (!aim_ssi_itemlist_find(od->ssi.official, cur1->gid, cur1->bid)) {
+		for (cur1=od->ssi.official; cur1 && (n < 15); cur1=cur1->next) {
+			if (!aim_ssi_itemlist_find(od->ssi.local, cur1->gid, cur1->bid)) {
 				n++;
 				new = (struct aim_ssi_tmp *)g_malloc(sizeof(struct aim_ssi_tmp));
-				new->action = SNAC_SUBTYPE_FEEDBAG_ADD;
+				new->action = SNAC_SUBTYPE_FEEDBAG_DEL;
 				new->ack = 0xffff;
 				new->name = NULL;
 				new->item = cur1;
@@ -525,13 +525,13 @@
 		}
 	}
 
-	/* Deletions */
+	/* Additions */
 	if (!od->ssi.pending) {
-		for (cur1=od->ssi.official; cur1 && (n < 15); cur1=cur1->next) {
-			if (!aim_ssi_itemlist_find(od->ssi.local, cur1->gid, cur1->bid)) {
+		for (cur1=od->ssi.local; cur1 && (n < 15); cur1=cur1->next) {
+			if (!aim_ssi_itemlist_find(od->ssi.official, cur1->gid, cur1->bid)) {
 				n++;
 				new = (struct aim_ssi_tmp *)g_malloc(sizeof(struct aim_ssi_tmp));
-				new->action = SNAC_SUBTYPE_FEEDBAG_DEL;
+				new->action = SNAC_SUBTYPE_FEEDBAG_ADD;
 				new->ack = 0xffff;
 				new->name = NULL;
 				new->item = cur1;