diff src/blist.c @ 12305:1504d878be54

[gaim-migrate @ 14609] Patch 1370694 from Sadrul to fix more buddy count problems: "If you have the same buddy in more than one group for an account, and that account goes offline, then the buddy-count shows wrong." committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Sat, 03 Dec 2005 18:35:37 +0000
parents 875f59f9c0bb
children 7630a95f3b8b
line wrap: on
line diff
--- a/src/blist.c	Sat Dec 03 18:07:39 2005 +0000
+++ b/src/blist.c	Sat Dec 03 18:35:37 2005 +0000
@@ -2235,6 +2235,7 @@
 	GaimChat *chat;
 	GaimContact *contact;
 	GaimGroup *group;
+	GList *list = NULL, *iter = NULL;
 
 	g_return_if_fail(gaimbuddylist != NULL);
 
@@ -2273,7 +2274,8 @@
 						if (contact->currentsize == 0)
 							group->currentsize--;
 
-						gaim_presence_set_status_active(presence, "offline", TRUE);
+						if (!g_list_find(list, presence))
+							list = g_list_prepend(list, presence);
 
 						if (ops && ops->remove)
 							ops->remove(gaimbuddylist, bnode);
@@ -2297,6 +2299,12 @@
 			}
 		}
 	}
+
+	for (iter = list; iter; iter = iter->next)
+	{
+		gaim_presence_set_status_active(iter->data, "offline", TRUE);
+	}
+	g_list_free(list);
 }
 
 gboolean gaim_group_on_account(GaimGroup *g, GaimAccount *account)