aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/connection.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/connection.cpp b/lib/connection.cpp
index 73fd786f..fcd73d04 100644
--- a/lib/connection.cpp
+++ b/lib/connection.cpp
@@ -576,7 +576,13 @@ void Connection::doInDirectChat(const User* u,
<< userId << "as" << roomId;
operation(room(roomId, JoinState::Join));
});
+ return;
}
+ // Avoid reusing previously left chats but don't remove them
+ // from direct chat maps, either.
+ if (room(roomId, JoinState::Leave))
+ continue;
+
qCWarning(MAIN) << "Direct chat with" << userId << "known as room"
<< roomId << "is not valid and will be discarded";
// Postpone actual deletion until we finish iterating d->directChats.