changeset 19457:f2a193f3bc90

merge of 'a8189d2840b6823a0faf5dbba937eb0dd96a1416' and 'fa54cd9cb960c227e6c2a03ef194facf1bcdf80a'
author Luke Schierer <lschiere@pidgin.im>
date Sun, 26 Aug 2007 20:49:25 +0000
parents 6950ffd2291f (diff) 752c33e7fdde (current diff)
children 2bccaf556994
files
diffstat 1 files changed, 16 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/roster.c	Sun Aug 26 19:30:45 2007 +0000
+++ b/libpurple/protocols/jabber/roster.c	Sun Aug 26 20:49:25 2007 +0000
@@ -58,6 +58,7 @@
 {
 	GSList *buddies, *g2, *l;
 	gchar *my_bare_jid;
+	GList *pool = NULL;
 
 	buddies = purple_find_buddies(js->gc->account, jid);
 
@@ -89,13 +90,20 @@
 			g_free(l->data);
 			g2 = g_slist_delete_link(g2, l);
 		} else {
-			purple_blist_remove_buddy(b);
+			pool = g_list_prepend(pool, b);
 		}
 	}
 
 	while(g2) {
-		PurpleBuddy *b = purple_buddy_new(js->gc->account, jid, alias);
 		PurpleGroup *g = purple_find_group(g2->data);
+		PurpleBuddy *b = NULL;
+
+		if (pool) {
+			b = pool->data;
+			pool = g_list_delete_link(pool, pool);
+		} else {			
+			b = purple_buddy_new(js->gc->account, jid, alias);
+		}
 
 		if(!g) {
 			g = purple_group_new(g2->data);
@@ -121,6 +129,12 @@
 		g2 = g_slist_delete_link(g2, g2);
 	}
 
+	while (pool) {
+		PurpleBuddy *b = pool->data;
+		purple_blist_remove_buddy(b);
+		pool = g_list_delete_link(pool, pool);
+	}
+
 	g_free(my_bare_jid);
 	g_slist_free(buddies);
 }