[gaim-migrate @ 14645]

Mon, 05 Dec 2005 04:10:08 +0000

author
Sadrul Habib Chowdhury <sadrul@pidgin.im>
date
Mon, 05 Dec 2005 04:10:08 +0000
changeset 12341
a4b5f9eb0d83
parent 12340
04baa672c79e
child 12342
da61b726d595

[gaim-migrate @ 14645]
sf patch #1367967, from Sadrul Habib Chowdhury

"When a buddy goes offline, and that buddy-node was
being displayed in an expanded contact, or the buddy
was the only online node under a group, then the
going-out-the-door icon is not displayed. This patch is
a fix for that."

committer: Mark Doliner <markdoliner@pidgin.im>

src/gtkblist.c file | annotate | diff | comparison | revisions
--- a/src/gtkblist.c	Mon Dec 05 03:53:00 2005 +0000
+++ b/src/gtkblist.c	Mon Dec 05 04:10:08 2005 +0000
@@ -3874,6 +3874,7 @@
 {
 	GaimGroup *group;
 	int count;
+	gboolean show = FALSE;
 
 	g_return_if_fail(GAIM_BLIST_NODE_IS_GROUP(node));
 
@@ -3883,7 +3884,24 @@
 		count = gaim_blist_get_group_size(group, FALSE);
 	else
 		count = gaim_blist_get_group_online_count(group);
-	if(gaim_prefs_get_bool("/gaim/gtk/blist/show_empty_groups") || count > 0) {
+	
+	if (count > 0 || gaim_prefs_get_bool("/gaim/gtk/blist/show_empty_groups"))
+		show = TRUE;
+	else {
+		GaimBlistNode *n;
+		n = node->child;
+		while (n && !GAIM_BLIST_NODE_IS_GROUP(n)) {
+			if (GAIM_BLIST_NODE_IS_BUDDY(n)) {
+				if (buddy_is_displayable((GaimBuddy*)n)) {
+					show = TRUE;
+					break;
+				}					
+			}
+			n = gaim_blist_node_next(n, FALSE);
+		}
+	}
+
+	if (show) {
 		char *mark, *esc;
 		GtkTreeIter iter;
 
@@ -4042,12 +4060,7 @@
 
 	gtkparentnode = (struct _gaim_gtk_blist_node *)node->parent->ui_data;
 
-	if (gtkparentnode->contact_expanded &&
-		(gaim_presence_is_online(buddy->presence) ||
-		(0 /* XXX: if we just signed off, need to show logout.png */) ||
-			(gaim_account_is_connected(buddy->account) &&
-				gaim_prefs_get_bool("/gaim/gtk/blist/show_offline_buddies")) ||
-			gaim_blist_node_get_bool(node->parent, "show_offline")))
+	if (gtkparentnode->contact_expanded && buddy_is_displayable(buddy))
 	{
 		GtkTreeIter iter;
 

mercurial