diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-04-05 19:25:40 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-04-05 19:25:40 +0900 |
commit | b8244eadff1dbe151fe15998cf60cb9b82e684e6 (patch) | |
tree | 36775e367a5ef4cd3414e02890abe9bd9cd2f808 /lib | |
parent | d76b2fbe30a503009d33c4df06848d7356fc39a6 (diff) | |
download | libquotient-b8244eadff1dbe151fe15998cf60cb9b82e684e6.tar.gz libquotient-b8244eadff1dbe151fe15998cf60cb9b82e684e6.zip |
Unofficially relax Qt requirement to 5.5.1
This is to support uMatriks that still has to compile on xenial codebase.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/connection.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
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; } |