Skip to content

Commit

Permalink
Room::switchVersion()
Browse files Browse the repository at this point in the history
  • Loading branch information
KitsuneRal committed Feb 16, 2019
1 parent 0130d96 commit 11b1bfe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/room.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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();
Expand Down
3 changes: 3 additions & 0 deletions lib/room.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
/**
Expand Down

0 comments on commit 11b1bfe

Please sign in to comment.