aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2018-08-11 18:13:33 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2018-08-11 18:55:49 +0900
commit082f233dc9f429d06548fba90c8129ef3f83a4b4 (patch)
tree1dcb02677e1f157815845dad14a81c2e62b5206e /lib
parent20b95b66b2cc0c8f69800570c3b1f0bc4aa413cf (diff)
downloadlibquotient-082f233dc9f429d06548fba90c8129ef3f83a4b4.tar.gz
libquotient-082f233dc9f429d06548fba90c8129ef3f83a4b4.zip
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.
Diffstat (limited to 'lib')
-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.