diff pidgin/gtkblist.c @ 18217:e3a4ed0febd2

fix double clicking joined chat by asking the prpl what the real name of the chat is
author Ka-Hing Cheung <khc@hxbc.us>
date Thu, 21 Jun 2007 05:58:23 +0000
parents 16bf31872b7a
children cbec54ecd9ab 83ea1733979b
line wrap: on
line diff
--- a/pidgin/gtkblist.c	Wed Jun 20 23:40:10 2007 +0000
+++ b/pidgin/gtkblist.c	Thu Jun 21 05:58:23 2007 +0000
@@ -291,15 +291,30 @@
 static void gtk_blist_join_chat(PurpleChat *chat)
 {
 	PurpleConversation *conv;
-
-	conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_CHAT,
-											   purple_chat_get_name(chat),
+	PurplePluginProtocolInfo *prpl_info;
+	const char *name;
+	char *chat_name;
+
+	prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_find_prpl(purple_account_get_protocol_id(chat->account)));
+
+	if (prpl_info && prpl_info->get_chat_name)
+		chat_name = prpl_info->get_chat_name(chat->components);
+	else
+		chat_name = NULL;
+
+	if (chat_name)
+		name = chat_name;
+	else
+		name = purple_chat_get_name(chat);
+
+	conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_CHAT, name,
 											   chat->account);
 
 	if (conv != NULL)
 		purple_conversation_present(conv);
 
 	serv_join_chat(chat->account->gc, chat->components);
+	g_free(chat_name);
 }
 
 static void gtk_blist_menu_join_cb(GtkWidget *w, PurpleChat *chat)