diff pidgin/gtkblist.c @ 15497:74efe677c8a5

Restore 'hidden convo' status icon in blist. Additionally, make the name text bold when you have a hidden convo
author Sean Egan <seanegan@gmail.com>
date Sat, 03 Feb 2007 00:59:00 +0000
parents fd4afe8bb584
children 45ecefd0ce3a
line wrap: on
line diff
--- a/pidgin/gtkblist.c	Fri Feb 02 23:07:47 2007 +0000
+++ b/pidgin/gtkblist.c	Sat Feb 03 00:59:00 2007 +0000
@@ -3064,7 +3064,19 @@
 	}
 	
 	if(buddy) {
-		GaimPresence *p = gaim_buddy_get_presence(buddy);
+	  	GaimConversation *conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM,
+									     gaim_buddy_get_name(buddy),
+									     gaim_buddy_get_account(buddy));
+		GaimPresence *p;
+		if(conv != NULL) {
+			GaimGtkConversation *gtkconv = GAIM_GTK_CONVERSATION(conv);
+			if(gtkconv != NULL && gaim_gtkconv_is_hidden(gtkconv) && size == GAIM_STATUS_ICON_SMALL) {
+				return gtk_widget_render_icon (GTK_WIDGET(gtkblist->treeview), PIDGIN_STOCK_STATUS_MESSAGE,
+							       icon_size, "GtkTreeView");
+			}
+		}
+		p = gaim_buddy_get_presence(buddy);
+	       
 		if (GAIM_BUDDY_IS_ONLINE(buddy) && gtkbuddynode && gtkbuddynode->recent_signonoff)
 			ret = gtk_widget_render_icon (GTK_WIDGET(gtkblist->treeview), PIDGIN_STOCK_STATUS_LOGIN,
 					icon_size, "GtkTreeView");
@@ -3222,6 +3234,19 @@
 	struct _gaim_gtk_blist_node *gtkcontactnode = NULL;
 	char *idletime = NULL, *statustext = NULL;
 	time_t t;
+	GaimConversation *conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM,
+								     gaim_buddy_get_name(b),
+								     gaim_buddy_get_account(b));
+	GaimGtkConversation *gtkconv;
+	gboolean hidden_conv = FALSE;
+
+	if(conv != NULL) {
+		gtkconv = GAIM_GTK_CONVERSATION(conv);
+		if(gtkconv != NULL && gaim_gtkconv_is_hidden(gtkconv)) {
+			hidden_conv = TRUE;
+		}
+	}
+	
 	/* XXX Good luck cleaning up this crap */
 
 	contact = (GaimContact*)((GaimBlistNode*)b)->parent;
@@ -3243,9 +3268,19 @@
 			text = g_strdup_printf("<span color='%s'>%s</span>",
 					       dim_grey(), esc);
 			g_free(esc);
+			if (hidden_conv) {
+				char *tmp = text;
+				text = g_strdup_printf("<b>%s</b>", text);
+				g_free(tmp);
+			}
 			return text;
 		}
 		else
+			if (hidden_conv) {
+				char *tmp = esc;
+				esc = g_strdup_printf("<b>%s</b>", esc);
+				g_free(tmp);
+			}
 			return esc;
 	}
 
@@ -3366,7 +3401,13 @@
 	g_free(idletime);
 	g_free(statustext);
 	g_free(esc);
-
+	
+	if (hidden_conv) {
+		char *tmp = text;
+		text = g_strdup_printf("<b>%s</b>", tmp);
+		g_free(tmp);
+	}
+	
 	return text;
 }