From 082f233dc9f429d06548fba90c8129ef3f83a4b4 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sat, 11 Aug 2018 18:13:33 +0900 Subject: Connection::doInDirectChat: don't remove invite/left rooms from direct chats Deletion of Invite rooms was a clear bug; as for left rooms, it makes sense to keep them in direct chat maps because they may be re-joined later on. --- lib/connection.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib') 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. -- cgit v1.2.3