aboutsummaryrefslogtreecommitdiff
path: root/events/roomtopicevent.h
diff options
context:
space:
mode:
Diffstat (limited to 'events/roomtopicevent.h')
-rw-r--r--events/roomtopicevent.h12
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;
};