aboutsummaryrefslogtreecommitdiff
path: root/room.cpp
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2018-03-05 11:44:00 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2018-03-05 16:15:01 +0900
commitf9cd6410623b7ddebf97e248584d1a8e838b4da8 (patch)
treeebd9e39f85b2d7586d4b0e713cf65003935a3945 /room.cpp
parentfcf335e202a49c62be29566daf233866cd2f3584 (diff)
downloadlibquotient-f9cd6410623b7ddebf97e248584d1a8e838b4da8.tar.gz
libquotient-f9cd6410623b7ddebf97e248584d1a8e838b4da8.zip
Room: addTag() and removeTag()
Slightly changed TagRecord constructors to match.
Diffstat (limited to 'room.cpp')
-rw-r--r--room.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/room.cpp b/room.cpp
index 86d1e6cd..cb94ddb6 100644
--- a/room.cpp
+++ b/room.cpp
@@ -586,6 +586,26 @@ TagRecord Room::tag(const QString& name) const
return d->tags.value(name);
}
+void Room::addTag(const QString& name, const TagRecord& record)
+{
+ if (d->tags.contains(name))
+ return;
+
+ d->tags.insert(name, record);
+ d->setAccountData(TagEvent(d->tags));
+ emit tagsChanged();
+}
+
+void Room::removeTag(const QString& name)
+{
+ if (!d->tags.contains(name))
+ return;
+
+ d->tags.remove(name);
+ d->setAccountData(TagEvent(d->tags));
+ emit tagsChanged();
+}
+
void Room::setTags(const TagsMap& newTags)
{
if (newTags == d->tags)