diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-09-15 18:43:29 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-09-21 20:59:14 +0900 |
commit | d51e7a43736096eb2776acd99e1aab6deeb65667 (patch) | |
tree | 3b9044cae8de81ba05f8b71f097705daef480227 /events | |
parent | 4eeecd2cf3c9a33878974b93211b29df891ecc9a (diff) | |
download | libquotient-d51e7a43736096eb2776acd99e1aab6deeb65667.tar.gz libquotient-d51e7a43736096eb2776acd99e1aab6deeb65667.zip |
jobs: SetRoomStateJob (with or without state key); setting room topic
Diffstat (limited to 'events')
-rw-r--r-- | events/roomtopicevent.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/events/roomtopicevent.h b/events/roomtopicevent.h index fb849afe..95ad0e04 100644 --- a/events/roomtopicevent.h +++ b/events/roomtopicevent.h @@ -25,6 +25,9 @@ namespace QMatrixClient class RoomTopicEvent: public RoomEvent { public: + explicit RoomTopicEvent(const QString& topic) + : RoomEvent(Type::RoomTopic), _topic(topic) + { } explicit RoomTopicEvent(const QJsonObject& obj) : RoomEvent(Type::RoomTopic, obj) , _topic(contentJson()["topic"].toString()) @@ -32,6 +35,15 @@ namespace QMatrixClient QString topic() const { return _topic; } + QJsonObject toJson() const + { + QJsonObject obj; + obj.insert("topic", _topic); + return obj; + } + + static constexpr const char* TypeId = "m.room.topic"; + private: QString _topic; }; |