comparison src/list.c @ 4701:ac7ca2bd6d4f

[gaim-migrate @ 5012] now groups go away when they're empty, like you would think they should. also fixes a segfault if someone signs on and off very quickly. committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Tue, 11 Mar 2003 03:59:42 +0000
parents 4bdd9a5fd026
children 06e8e5858121
comparison
equal deleted inserted replaced
4700:e52e19e33227 4701:ac7ca2bd6d4f
1281 struct gaim_blist_ui_ops * 1281 struct gaim_blist_ui_ops *
1282 gaim_get_blist_ui_ops(void) 1282 gaim_get_blist_ui_ops(void)
1283 { 1283 {
1284 return blist_ui_ops; 1284 return blist_ui_ops;
1285 } 1285 }
1286
1287 int gaim_blist_get_group_size(struct group *group, gboolean offline) {
1288 GaimBlistNode *node;
1289 int count = 0;
1290
1291 if(!group)
1292 return 0;
1293
1294 for(node = group->node.child; node; node = node->next) {
1295 if(GAIM_BLIST_NODE_IS_BUDDY(node)) {
1296 struct buddy *b = (struct buddy *)node;
1297 if(b->account->gc || offline)
1298 count++;
1299 }
1300 }
1301
1302 return count;
1303 }
1304
1305 int gaim_blist_get_group_online_count(struct group *group) {
1306 GaimBlistNode *node;
1307 int count = 0;
1308
1309 if(!group)
1310 return 0;
1311
1312 for(node = group->node.child; node; node = node->next) {
1313 if(GAIM_BLIST_NODE_IS_BUDDY(node)) {
1314 struct buddy *b = (struct buddy *)node;
1315 if(b->present)
1316 count++;
1317 }
1318 }
1319
1320 return count;
1321 }
1322
1323