# HG changeset patch # User Sadrul Habib Chowdhury # Date 1212619763 0 # Node ID a601807bae2ba04c82c301cb56015a1aeba5f2f7 # Parent d14289aed8eeb4645d81f96a5336610c3db36aa5 Fix chat joining from the 'Join a chat' dialog. Thanks to w00b on IRC for reporting the bug. diff -r d14289aed8ee -r a601807bae2b finch/gntblist.c --- a/finch/gntblist.c Tue Jun 03 22:34:32 2008 +0000 +++ b/finch/gntblist.c Wed Jun 04 22:49:23 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));