diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-03-05 11:44:00 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-03-05 16:15:01 +0900 |
commit | f9cd6410623b7ddebf97e248584d1a8e838b4da8 (patch) | |
tree | ebd9e39f85b2d7586d4b0e713cf65003935a3945 /room.cpp | |
parent | fcf335e202a49c62be29566daf233866cd2f3584 (diff) | |
download | libquotient-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.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -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) |