aboutsummaryrefslogtreecommitdiff
path: root/room.h
diff options
context:
space:
mode:
Diffstat (limited to 'room.h')
-rw-r--r--room.h29
1 files changed, 23 insertions, 6 deletions
diff --git a/room.h b/room.h
index 71d5c433..0eb5ecc3 100644
--- a/room.h
+++ b/room.h
@@ -20,13 +20,9 @@
#include "jobs/syncjob.h"
#include "events/roommessageevent.h"
-#include "events/tagevent.h"
+#include "events/accountdataevents.h"
#include "joinstate.h"
-#include <QtCore/QList>
-#include <QtCore/QStringList>
-#include <QtCore/QObject>
-#include <QtCore/QJsonObject>
#include <QtGui/QPixmap>
#include <memory>
@@ -241,9 +237,30 @@ namespace QMatrixClient
Q_INVOKABLE void resetHighlightCount();
QStringList tagNames() const;
- QHash<QString, TagRecord> tags() const;
+ TagsMap tags() const;
TagRecord tag(const QString& name) const;
+ /** Add a new tag to this room
+ * If this room already has this tag, nothing happens. If it's a new
+ * tag for the room, the respective tag record is added to the set
+ * of tags and the new set is sent to the server to update other
+ * clients.
+ */
+ void addTag(const QString& name, const TagRecord& record = {});
+
+ /** Remove a tag from the room */
+ void removeTag(const QString& name);
+
+ /** Overwrite the room's tags
+ * This completely replaces the existing room's tags with a set
+ * of new ones and updates the new set on the server. Unlike
+ * most other methods in Room, this one sends a signal about changes
+ * immediately, not waiting for confirmation from the server
+ * (because tags are saved in account data rather than in shared
+ * room state).
+ */
+ void setTags(const TagsMap& newTags);
+
/** Check whether the list of tags has m.favourite */
bool isFavourite() const;
/** Check whether the list of tags has m.lowpriority */