/pidgin/main: 187b51ce9922: Check that we actually don't have op...
Mat?j Cepl <[email protected]>
| Newsgroups | gmane.comp.gnome.gaim.cvs |
|---|---|
| Message-ID | <[email protected]> |
Changeset: 187b51ce992289389fd5c416c30471eecb6c5691 Author: Mat?j Cepl <[email protected]> Date: 2015-06-05 13:48 -0400 Branch: release-2.x.y URL: https://hg.pidgin.im/pidgin/main/rev/187b51ce9922 Description: Check that we actually don't have opened a tab with conversation we want to open. diffstat: libpurple/server.c | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-) diffs (23 lines): diff --git a/libpurple/server.c b/libpurple/server.c --- a/libpurple/server.c +++ b/libpurple/server.c @@ -850,7 +850,18 @@ PurpleConversation *serv_got_joined_chat g_return_val_if_fail(account != NULL, NULL); g_return_val_if_fail(name != NULL, NULL); - conv = purple_conversation_new(PURPLE_CONV_TYPE_CHAT, account, name); + conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_CHAT, + name, account); + if (!conv) { + purple_debug_info(NULL, "Opening %s chat on account %s", + name, account); + conv = purple_conversation_new(PURPLE_CONV_TYPE_CHAT, account, name); + } + else { + purple_debug_info(NULL, "Chat %s on account %s already exists", + name, account); + } + g_return_val_if_fail(conv != NULL, NULL); chat = PURPLE_CONV_CHAT(conv);