summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMat?j Cepl <mcepl@cepl.eu>2015-06-05 13:48:19 -0400
committerMat?j Cepl <mcepl@cepl.eu>2015-06-05 13:48:19 -0400
commit7aa7474aaa231eb80e4162d292698ef50ded78ff (patch)
treea97551344f2e5b7b0b5e271703b5ee4bf4703baf
parent0e6f5e7002f8a0f5821b3fe7d197becacfaae9c8 (diff)
downloadpidgin-7aa7474aaa231eb80e4162d292698ef50ded78ff.tar.gz
Check that we actually don't have opened a tab with conversation we want to open.
-rw-r--r--libpurple/server.c13
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);