aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlexey Rusakov <Kitsune-Ral@users.sf.net>2021-09-28 08:41:06 +0200
committerAlexey Rusakov <Kitsune-Ral@users.sf.net>2021-09-28 08:45:05 +0200
commit92024f20fd8cfe4adb586b1d477969e45ba9ab4d (patch)
treeb642b8995e59a78299f56e9f74049ccd552a3d78 /lib
parent9f43d34c590a825504b72be7f6b238d0ff2c915a (diff)
downloadlibquotient-92024f20fd8cfe4adb586b1d477969e45ba9ab4d.tar.gz
libquotient-92024f20fd8cfe4adb586b1d477969e45ba9ab4d.zip
SyncData: drop a shortcut that led to ignoring invites
Fixes #510.
Diffstat (limited to 'lib')
-rw-r--r--lib/syncdata.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/syncdata.cpp b/lib/syncdata.cpp
index d3c270b5..4edc9564 100644
--- a/lib/syncdata.cpp
+++ b/lib/syncdata.cpp
@@ -173,12 +173,7 @@ void SyncData::parseJson(const QJsonObject& json, const QString& baseDir)
auto rooms = json.value("rooms"_ls).toObject();
auto totalRooms = 0;
auto totalEvents = 0;
- // The first comparison shortcuts the loop when not all states are there
- // in the response (anything except "join" is only occasional, and "join"
- // intentionally comes first in the enum).
- for (size_t i = 0;
- static_cast<int>(i) < rooms.size() && i < JoinStateStrings.size(); ++i)
- {
+ for (size_t i = 0; i < JoinStateStrings.size(); ++i) {
// This assumes that MemberState values go over powers of 2: 1,2,4,...
const auto joinState = JoinState(1U << i);
const auto rs = rooms.value(JoinStateStrings[i]).toObject();