im.pidgin.pidgin: 4e3cab31e53166c95ce21536f6ebb84b904f6b58

sadrul at pidgin.im sadrul at pidgin.im
Tue Dec 4 20:37:00 EST 2007


-----------------------------------------------------------------
Revision: 4e3cab31e53166c95ce21536f6ebb84b904f6b58
Ancestor: 2f819082d4689d1ed20d907f670103fbafba4ec0
Author: sadrul at pidgin.im
Date: 2007-12-05T01:32:07
Branch: im.pidgin.pidgin

Modified files:
        pidgin/gtkblist.c

ChangeLog: 

Make sure we are still in the chat, and the chat can have a topic, when showing the topic in the tooltip.

-------------- next part --------------
============================================================
--- pidgin/gtkblist.c	46f11d4ba51bf814f214eee65f5ae5188e4dc643
+++ pidgin/gtkblist.c	9dd63f2810bc42c1b2dbdbf2af73731616e9161f
@@ -3183,7 +3183,9 @@ static char *pidgin_get_tooltip_text(Pur
 			g_free(tmp);
 		}
 
-		if (bnode && bnode->conv.conv) {
+		if (bnode && bnode->conv.conv &&
+				prpl_info && (prpl_info->options & OPT_PROTO_CHAT_TOPIC) &&
+				!purple_conv_chat_has_left(PURPLE_CONV_CHAT(bnode->conv.conv))) {
 			const char *topic = purple_conv_chat_get_topic(PURPLE_CONV_CHAT(bnode->conv.conv));
 			g_string_append_printf(str, _("\n<b>Topic:</b> %s"), topic ? topic : _("(no topic set)"));
 		}
@@ -3257,7 +3259,7 @@ static char *pidgin_get_tooltip_text(Pur
 		/* Alias */
 		/* If there's not a contact alias, the node is being displayed with
 		 * this alias, so there's no point in showing it in the tooltip. */
-		if (full && b->alias != NULL && b->alias[0] != '\0' &&
+		if (full && c && b->alias != NULL && b->alias[0] != '\0' &&
 		    (c->alias != NULL && c->alias[0] != '\0') &&
 		    strcmp(c->alias, b->alias) != 0)
 		{
@@ -3308,13 +3310,13 @@ static char *pidgin_get_tooltip_text(Pur
 		}
 
 		/* Last Seen */
-		if (full && !PURPLE_BUDDY_IS_ONLINE(b))
+		if (full && c && !PURPLE_BUDDY_IS_ONLINE(b))
 		{
 			struct _pidgin_blist_node *gtknode = ((PurpleBlistNode *)c)->ui_data;
 			PurpleBlistNode *bnode;
 			int lastseen = 0;
 
-			if (!gtknode->contact_expanded || PURPLE_BLIST_NODE_IS_CONTACT(node))
+			if (gtknode && (!gtknode->contact_expanded || PURPLE_BLIST_NODE_IS_CONTACT(node)))
 			{
 				/* We're either looking at a buddy for a collapsed contact or
 				 * an expanded contact itself so we show the most recent


More information about the Commits mailing list