From 4ea9c16b31b4936eaba4e7c2905672702d9d45bc Mon Sep 17 00:00:00 2001
From: Kevin Smith <git@kismith.co.uk>
Date: Sat, 28 Apr 2018 13:59:40 +0100
Subject: Don't duplicate blue-roster entries on reconnect

Test-Information:
Log in, go offline, go online. Before the patch this'd trigger duplicate
entries (and now it doesn't).

Change-Id: I651f8a0285e5e0748c263ab42f56aa86a3a2a3a1

diff --git a/Swift/Controllers/Chat/Chattables.cpp b/Swift/Controllers/Chat/Chattables.cpp
index b75e18d..599ff48 100644
--- a/Swift/Controllers/Chat/Chattables.cpp
+++ b/Swift/Controllers/Chat/Chattables.cpp
@@ -18,6 +18,9 @@ const Chattables::State& Chattables::getState(const JID& jid) const {
 }
 
 void Chattables::addJID(const JID& jid, State::Type type) {
+    if (states_.find(jid) != states_.end()) {
+        return;
+    }
     State state;
     state.type = type;
     state.jid = jid;
-- 
cgit v0.10.2-6-g49f6