From 11b1bfe8f3640bfb1e2dd1710624c67aedb4f98b Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sat, 16 Feb 2019 17:27:39 +0900 Subject: [PATCH] Room::switchVersion() Closes #236. --- lib/room.cpp | 6 ++++++ lib/room.h | 3 +++ 2 files changed, 9 insertions(+) diff --git a/lib/room.cpp b/lib/room.cpp index 23fb19db0..aa8358601 100644 --- a/lib/room.cpp +++ b/lib/room.cpp @@ -29,6 +29,7 @@ #include "csapi/room_send.h" #include "csapi/rooms.h" #include "csapi/tags.h" +#include "csapi/room_upgrades.h" #include "events/simplestateevents.h" #include "events/roomcreateevent.h" #include "events/roomtombstoneevent.h" @@ -791,6 +792,11 @@ void Room::resetHighlightCount() emit highlightCountChanged(this); } +void Room::switchVersion(QString newVersion) +{ + connection()->callApi(id(), newVersion); +} + bool Room::hasAccountData(const QString& type) const { return d->accountData.find(type) != d->accountData.end(); diff --git a/lib/room.h b/lib/room.h index 0636ba174..e09da94c3 100644 --- a/lib/room.h +++ b/lib/room.h @@ -424,6 +424,9 @@ namespace QMatrixClient /// Mark all messages in the room as read void markAllMessagesAsRead(); + /// Switch the room's version (aka upgrade) + void switchVersion(QString newVersion); + signals: /// Initial set of state events has been loaded /**