# HG changeset patch # User Sadrul Habib Chowdhury # Date 1240420061 0 # Node ID 9e0001caa207de1404086ab76bc4db85067394a3 # Parent 474a0cb44f58e2c10f31959bd2fe9815bd50536a Italicize nicks in the conversation history for folks leaving a chat. Does this belong in a plugin? diff -r 474a0cb44f58 -r 9e0001caa207 ChangeLog --- a/ChangeLog Tue Apr 21 22:17:18 2009 +0000 +++ b/ChangeLog Wed Apr 22 17:07:41 2009 +0000 @@ -28,7 +28,6 @@ channels. * Notify the user if a /nick command fails, rather than trying fallback nicks. - Pidgin: * Added -f command line option to tell Pidgin to ignore NetworkManager @@ -44,6 +43,9 @@ new dialog box every time a pounce is triggered. (Jorge VillaseƱor) * The New Account dialog is now broken into three tabs. Proxy configuration has been moved from the Advanced tab to the new tab. + * The nicks of the persons who leave the chatroom are italicized in the + chat's conversation history. The nicks are un-italicized when they + rejoin. Finch: * The hardware cursor is updated correctly. This will be useful diff -r 474a0cb44f58 -r 9e0001caa207 pidgin/gtkconv.c --- a/pidgin/gtkconv.c Tue Apr 21 22:17:18 2009 +0000 +++ b/pidgin/gtkconv.c Wed Apr 22 17:07:41 2009 +0000 @@ -4034,6 +4034,11 @@ "send-name"); g_object_get(tag, "foreground-gdk", &color, NULL); } else { + GtkTextTag *tag; + if ((tag = get_buddy_tag(conv, name, 0, FALSE))) + g_object_set(G_OBJECT(tag), "style", PANGO_STYLE_NORMAL, NULL); + if ((tag = get_buddy_tag(conv, name, PURPLE_MESSAGE_NICK, FALSE))) + g_object_set(G_OBJECT(tag), "style", PANGO_STYLE_NORMAL, NULL); color = (GdkColor*)get_nick_color(gtkconv, name); } @@ -6063,6 +6068,7 @@ PurpleConvChatBuddy *cbuddy; GtkTreeIter iter; GtkTreeModel *model; + GtkTextTag *tag; int f = 1; chat = PURPLE_CONV_CHAT(conv); @@ -6090,6 +6096,11 @@ g_free(val); } + if ((tag = get_buddy_tag(conv, old_name, 0, FALSE))) + g_object_set(G_OBJECT(tag), "style", PANGO_STYLE_ITALIC, NULL); + if ((tag = get_buddy_tag(conv, old_name, PURPLE_MESSAGE_NICK, FALSE))) + g_object_set(G_OBJECT(tag), "style", PANGO_STYLE_ITALIC, NULL); + if (!purple_conv_chat_find_user(chat, old_name)) return; @@ -6112,6 +6123,7 @@ char tmp[BUF_LONG]; int num_users; gboolean f; + GtkTextTag *tag; chat = PURPLE_CONV_CHAT(conv); gtkconv = PIDGIN_CONVERSATION(conv); @@ -6144,6 +6156,11 @@ g_free(val); } while (f); + + if ((tag = get_buddy_tag(conv, l->data, 0, FALSE))) + g_object_set(G_OBJECT(tag), "style", PANGO_STYLE_ITALIC, NULL); + if ((tag = get_buddy_tag(conv, l->data, PURPLE_MESSAGE_NICK, FALSE))) + g_object_set(G_OBJECT(tag), "style", PANGO_STYLE_ITALIC, NULL); } g_snprintf(tmp, sizeof(tmp),