aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/room.cpp6
-rw-r--r--lib/room.h3
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();
diff --git a/lib/room.h b/lib/room.h
index 0636ba17..e09da94c 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
/**