im.pidgin.pidgin: bf0838b152a3c0de2a03ee2007286559039c7f22

charkins at pidgin.im charkins at pidgin.im
Mon Oct 15 00:55:52 EDT 2007


-----------------------------------------------------------------
Revision: bf0838b152a3c0de2a03ee2007286559039c7f22
Ancestor: 23e3bb111a5b55d5bfab183bef2066946ddd73f3
Author: charkins at pidgin.im
Date: 2007-10-15T04:37:41
Branch: im.pidgin.pidgin

Modified files:
        pidgin/gtkdocklet.c

ChangeLog: 

Handle unattached conversations appropriately when drawing tooltip for
unread messages. Use pidgin_conv_present_conversation() which will
attach a UI if necessary.


-------------- next part --------------
============================================================
--- pidgin/gtkdocklet.c	e9549c61d2e3bdf8d4e7c632a8ca8504bdf886b6
+++ pidgin/gtkdocklet.c	d3fbe3800758c767e9d16957a12e040757e9afdd
@@ -145,15 +145,22 @@ docklet_update_status()
 		if (ui_ops->set_tooltip) {
 			GString *tooltip_text = g_string_new("");
 			for (l = convs, count = 0 ; l != NULL ; l = l->next, count++) {
-				if (PIDGIN_IS_PIDGIN_CONVERSATION(l->data)) {
-					PidginConversation *gtkconv = PIDGIN_CONVERSATION((PurpleConversation *)l->data);
-					if (count == DOCKLET_TOOLTIP_LINE_LIMIT - 1)
-						g_string_append(tooltip_text, _("Right-click for more unread messages...\n"));
-					else
-						g_string_append_printf(tooltip_text,
-							ngettext("%d unread message from %s\n", "%d unread messages from %s\n", gtkconv->unseen_count),
-							gtkconv->unseen_count,
-							gtk_label_get_text(GTK_LABEL(gtkconv->tab_label)));
+				PurpleConversation *conv = (PurpleConversation *)l->data;
+				PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv);
+
+				if (count == DOCKLET_TOOLTIP_LINE_LIMIT - 1) {
+					g_string_append(tooltip_text, _("Right-click for more unread messages...\n"));
+				} else if(gtkconv) {
+					g_string_append_printf(tooltip_text,
+						ngettext("%d unread message from %s\n", "%d unread messages from %s\n", gtkconv->unseen_count),
+						gtkconv->unseen_count,
+						gtk_label_get_text(GTK_LABEL(gtkconv->tab_label)));
+				} else {
+					g_string_append_printf(tooltip_text,
+						ngettext("%d unread message from %s\n", "%d unread messages from %s\n",
+						GPOINTER_TO_INT(purple_conversation_get_data(conv, "unseen-count"))),
+						GPOINTER_TO_INT(purple_conversation_get_data(conv, "unseen-count")),
+						purple_conversation_get_name(conv));
 				}
 			}
 
@@ -758,7 +765,7 @@ pidgin_docklet_clicked(int button_type)
 			if (pending) {
 				GList *l = get_pending_list(1);
 				if (l != NULL) {
-					purple_conversation_present((PurpleConversation *)l->data);
+					pidgin_conv_present_conversation((PurpleConversation *)l->data);
 					g_list_free(l);
 				}
 			} else {


More information about the Commits mailing list