# HG changeset patch # User Stu Tomlinson # Date 1205081527 0 # Node ID 8802eddbfedccc521d040165d52154695af7a537 # Parent df336908dd15f0fcbdd9c5455088c3502176d7b2 Fix Topic in chat node tooltips, and turn on using the transient chat node for chats not on the buddy list when building tooltips. I hope this doesn't break too much. diff -r df336908dd15 -r 8802eddbfedc pidgin/gtkblist.c --- a/pidgin/gtkblist.c Sun Mar 09 16:46:04 2008 +0000 +++ b/pidgin/gtkblist.c Sun Mar 09 16:52:07 2008 +0000 @@ -3132,6 +3132,8 @@ GList *cur; struct proto_chat_entry *pce; char *name, *value; + const char *chat_name; + PurpleConversation *conv; PidginBlistNode *bnode = node->ui_data; chat = (PurpleChat *)node; @@ -3145,11 +3147,22 @@ g_free(tmp); } - 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)); + if (bnode && bnode->conv.conv) { + conv = bnode->conv.conv; + } else { + if (prpl_info && prpl_info->get_chat_name) + chat_name = prpl_info->get_chat_name(chat->components); + else + chat_name = purple_chat_get_name(chat); + + conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_CHAT, chat_name, + chat->account); + } + if (conv && prpl_info && (prpl_info->options & OPT_PROTO_CHAT_TOPIC) && + !purple_conv_chat_has_left(PURPLE_CONV_CHAT(conv))) { + char *topic = g_markup_escape_text(purple_conv_chat_get_topic(PURPLE_CONV_CHAT(conv)), -1); g_string_append_printf(str, _("\nTopic: %s"), topic ? topic : _("(no topic set)")); + g_free(topic); } if (prpl_info->chat_info != NULL) diff -r df336908dd15 -r 8802eddbfedc pidgin/gtkconv.c --- a/pidgin/gtkconv.c Sun Mar 09 16:46:04 2008 +0000 +++ b/pidgin/gtkconv.c Sun Mar 09 16:52:07 2008 +0000 @@ -4577,14 +4577,12 @@ conv = gtkconv->active_conv; if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) { node = (PurpleBlistNode*)(purple_blist_find_chat(conv->account, conv->name)); -#if 0 - /* Using the transient blist nodes to show the tooltip doesn't quite work yet. */ if (!node) node = g_object_get_data(G_OBJECT(gtkconv->imhtml), "transient_chat"); -#endif } else { node = (PurpleBlistNode*)(purple_find_buddy(conv->account, conv->name)); #if 0 + /* Using the transient blist nodes to show the tooltip doesn't quite work yet. */ if (!node) node = g_object_get_data(G_OBJECT(gtkconv->imhtml), "transient_buddy"); #endif