aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2019-03-26 11:58:12 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2019-03-26 11:58:12 +0900
commitd8147d4ad8493ae9de94aee8a222a24d000a7c96 (patch)
tree7b32440efcb0a04f00598432052a115e8b405288 /lib
parent866b3d2155c0c7f2a58bb1a3c6355129361cb53a (diff)
downloadlibquotient-d8147d4ad8493ae9de94aee8a222a24d000a7c96.tar.gz
libquotient-d8147d4ad8493ae9de94aee8a222a24d000a7c96.zip
Room::canSwitchVersions(): return false on tombstoned rooms
A softer take on #306.
Diffstat (limited to 'lib')
-rw-r--r--lib/room.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/room.cpp b/lib/room.cpp
index 411a17d6..4ce1bee3 100644
--- a/lib/room.cpp
+++ b/lib/room.cpp
@@ -600,6 +600,9 @@ void Room::markAllMessagesAsRead()
bool Room::canSwitchVersions() const
{
+ if (!successorId().isEmpty())
+ return false; // Noone can upgrade a room that's already upgraded
+
// TODO, #276: m.room.power_levels
const auto* plEvt =
d->currentState.value({"m.room.power_levels", ""});