aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2019-03-10 16:59:55 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2019-03-10 16:59:55 +0900
commit8c685b4ae5b47e55a55f23e16ccbda0132cb60c5 (patch)
treeebd3a4bb8099dbb9d61da9e216c825a0b9167807
parentb467b0816f5f6816778f90b55a9d0b5437310fd5 (diff)
downloadlibquotient-8c685b4ae5b47e55a55f23e16ccbda0132cb60c5.tar.gz
libquotient-8c685b4ae5b47e55a55f23e16ccbda0132cb60c5.zip
Room::checkVersion(): be tolerant to already upgraded rooms
-rw-r--r--lib/connection.cpp3
-rw-r--r--lib/room.cpp2
2 files changed, 2 insertions, 3 deletions
diff --git a/lib/connection.cpp b/lib/connection.cpp
index 26b40c03..59aca025 100644
--- a/lib/connection.cpp
+++ b/lib/connection.cpp
@@ -271,8 +271,7 @@ void Connection::reloadCapabilities()
Q_ASSERT(!d->capabilities.roomVersions.omitted());
emit capabilitiesLoaded();
for (auto* r: d->roomMap)
- if (r->joinState() == JoinState::Join && r->successorId().isEmpty())
- r->checkVersion();
+ r->checkVersion();
});
}
diff --git a/lib/room.cpp b/lib/room.cpp
index 5da9373e..f2e03e94 100644
--- a/lib/room.cpp
+++ b/lib/room.cpp
@@ -1634,7 +1634,7 @@ void Room::checkVersion()
{
const auto defaultVersion = connection()->defaultRoomVersion();
const auto stableVersions = connection()->stableRoomVersions();
- Q_ASSERT(!defaultVersion.isEmpty() && successorId().isEmpty());
+ Q_ASSERT(!defaultVersion.isEmpty());
// This method is only called after the base state has been loaded
// or the server capabilities have been loaded.
emit stabilityUpdated(defaultVersion, stableVersions);