diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-04-02 14:08:53 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-04-02 14:08:53 +0900 |
commit | e003ffd274127a9f734f18c736d28be936a0dc89 (patch) | |
tree | 9a8764fecb1507f514e3d9ef982482f579e32000 /lib/room.cpp | |
parent | 9b856f28f2745a6d1f0425b8e7ac9c91119f3f36 (diff) | |
download | libquotient-e003ffd274127a9f734f18c736d28be936a0dc89.tar.gz libquotient-e003ffd274127a9f734f18c736d28be936a0dc89.zip |
Room/Connection: accountData()/accountDataChanged()
Generic account data are at least readable now (you can get, say,
pushers from the library without it even being aware of what a pusher
is).
Diffstat (limited to 'lib/room.cpp')
-rw-r--r-- | lib/room.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/room.cpp b/lib/room.cpp index 25669889..edbc9266 100644 --- a/lib/room.cpp +++ b/lib/room.cpp @@ -632,6 +632,16 @@ void Room::resetHighlightCount() emit highlightCountChanged(this); } +bool Room::hasAccountData(const QString& type) const +{ + return d->accountData.contains(type); +} + +QVariantHash Room::accountData(const QString& type) const +{ + return d->accountData.value(type); +} + QStringList Room::tagNames() const { return d->tags.keys(); @@ -1644,6 +1654,7 @@ void Room::processAccountDataEvent(EventPtr event) default: d->accountData[event->jsonType()] = event->contentJson().toVariantHash(); + emit accountDataChanged(event->jsonType()); } } |