# HG changeset patch # User Stu Tomlinson # Date 1180973914 0 # Node ID 1873848dfddb8f8da8add85b46d3aeab0dbc6608 # Parent ac504f6430921588378b2e6caba78e8c126b01b1 Make the Conversation->More menu work for Chats. The chat needs to be on your buddy list for this to work. Creating a transient PurpleChat blist node for generating the menu for chats not on the buddy list does not work well because the menu item callbacks expect the node to still exist. diff -r ac504f643092 -r 1873848dfddb pidgin/gtkconv.c --- a/pidgin/gtkconv.c Mon Jun 04 14:31:08 2007 +0000 +++ b/pidgin/gtkconv.c Mon Jun 04 16:18:34 2007 +0000 @@ -2897,14 +2897,25 @@ GList *list; PidginConversation *gtkconv; PurpleConversation *conv; - PurpleBuddy *buddy; + PurpleBlistNode *node = NULL; + PurpleChat *chat = NULL; + PurpleBuddy *buddy = NULL; gtkconv = pidgin_conv_window_get_active_gtkconv(win); conv = gtkconv->active_conv; - buddy = purple_find_buddy(conv->account, conv->name); menu = gtk_item_factory_get_widget(win->menu.item_factory, N_("/Conversation/More")); + if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) + chat = purple_blist_find_chat(conv->account, conv->name); + else + buddy = purple_find_buddy(conv->account, conv->name); + + if (chat) + node = (PurpleBlistNode *)chat; + else if (buddy) + node = (PurpleBlistNode *)buddy; + /* Remove the previous entries */ for (list = gtk_container_get_children(GTK_CONTAINER(menu)); list; ) { @@ -2914,12 +2925,11 @@ } /* Now add the stuff */ - if (buddy) + if (node) { if (purple_account_is_connected(conv->account)) - pidgin_append_blist_node_proto_menu(menu, conv->account->gc, - (PurpleBlistNode *)buddy); - pidgin_append_blist_node_extended_menu(menu, (PurpleBlistNode *)buddy); + pidgin_append_blist_node_proto_menu(menu, conv->account->gc, node); + pidgin_append_blist_node_extended_menu(menu, node); } if ((list = gtk_container_get_children(GTK_CONTAINER(menu))) == NULL)