diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2019-02-16 17:27:39 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2019-02-16 17:27:39 +0900 |
commit | 11b1bfe8f3640bfb1e2dd1710624c67aedb4f98b (patch) | |
tree | f00d53b8e53a601546f011a7eb6877a512d79985 | |
parent | 0130d9646af5530180158854dbedc35d7c01fd4f (diff) | |
download | libquotient-11b1bfe8f3640bfb1e2dd1710624c67aedb4f98b.tar.gz libquotient-11b1bfe8f3640bfb1e2dd1710624c67aedb4f98b.zip |
Room::switchVersion()
Closes #236.
-rw-r--r-- | lib/room.cpp | 6 | ||||
-rw-r--r-- | lib/room.h | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/lib/room.cpp b/lib/room.cpp index 23fb19db..aa835860 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<UpgradeRoomJob>(id(), newVersion); +} + bool Room::hasAccountData(const QString& type) const { return d->accountData.find(type) != d->accountData.end(); @@ -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 /** |