Add room upgrade button

Add button to upgrade the room if the user has a high enough power level and the room is not at the highest available version.
This commit is contained in:
James Graham
2022-12-30 13:51:34 +00:00
parent fa67d174d2
commit 893ee4a763
3 changed files with 65 additions and 0 deletions

View File

@@ -65,6 +65,13 @@ class NeoChatRoom : public Quotient::Room
Q_PROPERTY(QString chatBoxAttachmentPath READ chatBoxAttachmentPath WRITE setChatBoxAttachmentPath NOTIFY chatBoxAttachmentPathChanged)
Q_PROPERTY(bool canEncryptRoom READ canEncryptRoom NOTIFY canEncryptRoomChanged)
/**
* @brief Get the maximum room version that the server supports.
*
* Only returns main integer room versions (i.e. no msc room versions).
*/
Q_PROPERTY(int maxRoomVersion READ maxRoomVersion NOTIFY maxRoomVersionChanged)
public:
enum MessageType {
Positive,
@@ -223,6 +230,8 @@ public:
}
#endif
int maxRoomVersion() const;
private:
QSet<const Quotient::RoomEvent *> highlights;
@@ -274,6 +283,7 @@ Q_SIGNALS:
void canEncryptRoomChanged();
void joinRuleChanged();
void historyVisibilityChanged();
void maxRoomVersionChanged();
public Q_SLOTS:
void uploadFile(const QUrl &url, const QString &body = QString());