# HG changeset patch # User Sadrul Habib Chowdhury # Date 1212619840 0 # Node ID af23a35234b9cc13aea0f4734cfc3aecdac90de0 # Parent ea998456c3bd5c4ed00f9a1ddbde1d1fdc0370f2# Parent a601807bae2ba04c82c301cb56015a1aeba5f2f7 merge of '5e69fb5f354ed74d6deb6f4d1f6aff46afd8a072' and '6560ae1eff40239f99f3ea8c8e93c28572295399' diff -r ea998456c3bd -r af23a35234b9 finch/gntblist.c --- a/finch/gntblist.c Wed Jun 04 03:22:36 2008 +0000 +++ b/finch/gntblist.c Wed Jun 04 22:50:40 2008 +0000 @@ -2722,6 +2722,7 @@ PurpleConnection *gc; PurpleChat *chat; GHashTable *hash = NULL; + PurpleConversation *conv; account = purple_request_fields_get_account(fields, "account"); name = purple_request_fields_get_string(fields, "chat"); @@ -2730,7 +2731,16 @@ return; gc = purple_account_get_connection(account); - purple_conversation_new(PURPLE_CONV_TYPE_CHAT, account, name); + /* Create a new conversation now. This will give focus to the new window. + * But it's necessary to pretend that we left the chat, because otherwise + * a new conversation window will pop up when we finally join the chat. */ + if (!(conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_CHAT, name, account))) { + conv = purple_conversation_new(PURPLE_CONV_TYPE_CHAT, account, name); + purple_conv_chat_left(PURPLE_CONV_CHAT(conv)); + } else { + purple_conversation_present(conv); + } + chat = purple_blist_find_chat(account, name); if (chat == NULL) { PurplePluginProtocolInfo *info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc));