# HG changeset patch # User Sadrul Habib Chowdhury # Date 1179436291 0 # Node ID 17117b8cfbb757f9cc078866b6bc0f193a513d8a # Parent ec6a029c865de46ab041a7f97b6383640e35508f Patch from SuperMMX to correctly update the expand state of contacts when a group is collapsed. This closes #525. diff -r ec6a029c865d -r 17117b8cfbb7 pidgin/gtkblist.c --- a/pidgin/gtkblist.c Thu May 17 14:38:35 2007 +0000 +++ b/pidgin/gtkblist.c Thu May 17 21:11:31 2007 +0000 @@ -782,7 +782,8 @@ gtk_widget_show_all(data->window); } -static void gtk_blist_row_expanded_cb(GtkTreeView *tv, GtkTreeIter *iter, GtkTreePath *path, gpointer user_data) { +static void gtk_blist_row_expanded_cb(GtkTreeView *tv, GtkTreeIter *iter, GtkTreePath *path, gpointer user_data) +{ PurpleBlistNode *node; GValue val; @@ -806,7 +807,8 @@ } } -static void gtk_blist_row_collapsed_cb(GtkTreeView *tv, GtkTreeIter *iter, GtkTreePath *path, gpointer user_data) { +static void gtk_blist_row_collapsed_cb(GtkTreeView *tv, GtkTreeIter *iter, GtkTreePath *path, gpointer user_data) +{ PurpleBlistNode *node; GValue val; @@ -817,6 +819,8 @@ if (PURPLE_BLIST_NODE_IS_GROUP(node)) { char *title; + struct _pidgin_blist_node *gtknode; + PurpleBlistNode *cnode; title = pidgin_get_group_title(node, FALSE); @@ -827,6 +831,17 @@ g_free(title); purple_blist_node_set_bool(node, "collapsed", TRUE); + + for(cnode = node->child; cnode; cnode = cnode->next) { + if (PURPLE_BLIST_NODE_IS_CONTACT(cnode)) { + gtknode = cnode->ui_data; + if (!gtknode->contact_expanded) + continue; + gtknode->contact_expanded = FALSE; + pidgin_blist_update_contact(NULL, cnode); + } + } + } else if(PURPLE_BLIST_NODE_IS_CONTACT(node)) { pidgin_blist_collapse_contact_cb(NULL, node); }