# HG changeset patch # User Sadrul Habib Chowdhury # Date 1157135390 0 # Node ID 2a5ec27c3f0c4dd64e6baa42d2f2efea64b84b51 # Parent c72f33e14f9821459e97fb6d853c8716d77025c7 [gaim-migrate @ 17115] This should fix the problem. I am not sure why this is necessary though. committer: Tailor Script diff -r c72f33e14f98 -r 2a5ec27c3f0c console/gntblist.c --- a/console/gntblist.c Fri Sep 01 18:18:04 2006 +0000 +++ b/console/gntblist.c Fri Sep 01 18:29:50 2006 +0000 @@ -72,6 +72,30 @@ static const char * get_display_name(GaimBlistNode *node); static void savedstatus_changed(GaimSavedStatus *now, GaimSavedStatus *old); +static gboolean +is_contact_online(GaimContact *contact) +{ + GaimBlistNode *node; + for (node = ((GaimBlistNode*)contact)->child; node; node = node->next) { + if (GAIM_BUDDY_IS_ONLINE((GaimBuddy*)node)) + return TRUE; + } + return FALSE; +} + +static gboolean +is_group_online(GaimGroup *group) +{ + GaimBlistNode *node; + for (node = ((GaimBlistNode*)group)->child; node; node = node->next) { + if (GAIM_BLIST_NODE_IS_CHAT(node)) + return TRUE; + else if (is_contact_online((GaimContact*)node)) + return TRUE; + } + return FALSE; +} + static void new_node(GaimBlistNode *node) { @@ -111,11 +135,12 @@ if (GAIM_BLIST_NODE_IS_BUDDY(node)) { GaimContact *contact = (GaimContact*)node->parent; - if (contact->online < 1) + if ((!gaim_prefs_get_bool(PREF_ROOT "/showoffline") && !is_contact_online(contact)) || + contact->currentsize < 1) node_remove(list, (GaimBlistNode*)contact); } else if (GAIM_BLIST_NODE_IS_CONTACT(node)) { GaimGroup *group = (GaimGroup*)node->parent; - if ((!gaim_prefs_get_bool(PREF_ROOT "/showoffline") && group->online < 1) || + if ((!gaim_prefs_get_bool(PREF_ROOT "/showoffline") && !is_group_online(group)) || group->currentsize < 1) node_remove(list, node->parent); } @@ -149,6 +174,16 @@ node_update(list, node->parent); } else if (GAIM_BLIST_NODE_IS_CHAT(node)) { add_chat((GaimChat *)node, list->ui_data); + } else if (GAIM_BLIST_NODE_IS_CONTACT(node)) { + GaimContact *contact = (GaimContact*)node; + if ((!gaim_prefs_get_bool(PREF_ROOT "/showoffline") && !is_contact_online(contact)) || + contact->currentsize < 1) + node_remove(gaim_get_blist(), node); + } else if (GAIM_BLIST_NODE_IS_GROUP(node)) { + GaimGroup *group = (GaimGroup*)node; + if ((!gaim_prefs_get_bool(PREF_ROOT "/showoffline") && !is_group_online(group)) || + group->currentsize < 1) + node_remove(list, node); } }