From b8244eadff1dbe151fe15998cf60cb9b82e684e6 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Thu, 5 Apr 2018 19:25:40 +0900 Subject: Unofficially relax Qt requirement to 5.5.1 This is to support uMatriks that still has to compile on xenial codebase. --- lib/connection.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/connection.cpp b/lib/connection.cpp index 71ada8f7..600ab396 100644 --- a/lib/connection.cpp +++ b/lib/connection.cpp @@ -705,8 +705,14 @@ Connection::DirectChatsMap Connection::directChats() const QJsonObject toJson(const Connection::DirectChatsMap& directChats) { QJsonObject json; - for (auto it = directChats.keyBegin(); it != directChats.keyEnd(); ++it) - json.insert((*it)->id(), toJson(directChats.values(*it))); + for (auto it = directChats.begin(); it != directChats.end();) + { + QJsonArray roomIds; + const auto* user = it.key(); + for (; it != directChats.end() && it.key() == user; ++it) + roomIds.append(*it); + json.insert(user->id(), roomIds); + } return json; } -- cgit v1.2.3