Mercurial > pidgin
comparison 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 |
comparison
equal
deleted
inserted
replaced
12304:ae190d00b06d | 12305:1504d878be54 |
---|---|
2233 GaimBlistNode *gnode, *cnode, *bnode; | 2233 GaimBlistNode *gnode, *cnode, *bnode; |
2234 GaimBuddy *buddy; | 2234 GaimBuddy *buddy; |
2235 GaimChat *chat; | 2235 GaimChat *chat; |
2236 GaimContact *contact; | 2236 GaimContact *contact; |
2237 GaimGroup *group; | 2237 GaimGroup *group; |
2238 GList *list = NULL, *iter = NULL; | |
2238 | 2239 |
2239 g_return_if_fail(gaimbuddylist != NULL); | 2240 g_return_if_fail(gaimbuddylist != NULL); |
2240 | 2241 |
2241 for (gnode = gaimbuddylist->root; gnode; gnode = gnode->next) { | 2242 for (gnode = gaimbuddylist->root; gnode; gnode = gnode->next) { |
2242 if (!GAIM_BLIST_NODE_IS_GROUP(gnode)) | 2243 if (!GAIM_BLIST_NODE_IS_GROUP(gnode)) |
2271 | 2272 |
2272 contact->currentsize--; | 2273 contact->currentsize--; |
2273 if (contact->currentsize == 0) | 2274 if (contact->currentsize == 0) |
2274 group->currentsize--; | 2275 group->currentsize--; |
2275 | 2276 |
2276 gaim_presence_set_status_active(presence, "offline", TRUE); | 2277 if (!g_list_find(list, presence)) |
2278 list = g_list_prepend(list, presence); | |
2277 | 2279 |
2278 if (ops && ops->remove) | 2280 if (ops && ops->remove) |
2279 ops->remove(gaimbuddylist, bnode); | 2281 ops->remove(gaimbuddylist, bnode); |
2280 } | 2282 } |
2281 } | 2283 } |
2295 ops->remove(gaimbuddylist, cnode); | 2297 ops->remove(gaimbuddylist, cnode); |
2296 } | 2298 } |
2297 } | 2299 } |
2298 } | 2300 } |
2299 } | 2301 } |
2302 | |
2303 for (iter = list; iter; iter = iter->next) | |
2304 { | |
2305 gaim_presence_set_status_active(iter->data, "offline", TRUE); | |
2306 } | |
2307 g_list_free(list); | |
2300 } | 2308 } |
2301 | 2309 |
2302 gboolean gaim_group_on_account(GaimGroup *g, GaimAccount *account) | 2310 gboolean gaim_group_on_account(GaimGroup *g, GaimAccount *account) |
2303 { | 2311 { |
2304 GaimBlistNode *cnode; | 2312 GaimBlistNode *cnode; |