diff options
author | Mat?j Cepl <mcepl@cepl.eu> | 2015-06-05 13:48:19 -0400 |
---|---|---|
committer | Mat?j Cepl <mcepl@cepl.eu> | 2015-06-05 13:48:19 -0400 |
commit | 7aa7474aaa231eb80e4162d292698ef50ded78ff (patch) | |
tree | a97551344f2e5b7b0b5e271703b5ee4bf4703baf | |
parent | 0e6f5e7002f8a0f5821b3fe7d197becacfaae9c8 (diff) | |
download | pidgin-7aa7474aaa231eb80e4162d292698ef50ded78ff.tar.gz |
Check that we actually don't have opened a tab with conversation we want to open.
-rw-r--r-- | libpurple/server.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/libpurple/server.c b/libpurple/server.c index 27a796ffef..dc07d24def 100644 --- a/libpurple/server.c +++ b/libpurple/server.c @@ -850,7 +850,18 @@ PurpleConversation *serv_got_joined_chat(PurpleConnection *gc, 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); |