Skip to content

Commit

Permalink
Room::checkVersion(): be tolerant to already upgraded rooms
Browse files Browse the repository at this point in the history
  • Loading branch information
KitsuneRal committed Mar 10, 2019
1 parent b467b08 commit 8c685b4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions lib/connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
}

Expand Down
2 changes: 1 addition & 1 deletion lib/room.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8c685b4

Please sign in to comment.