diff options
-rw-r--r-- | events/roomtopicevent.cpp | 9 | ||||
-rw-r--r-- | events/roomtopicevent.h | 3 |
2 files changed, 10 insertions, 2 deletions
diff --git a/events/roomtopicevent.cpp b/events/roomtopicevent.cpp index 5739d85e..7ccfc73c 100644 --- a/events/roomtopicevent.cpp +++ b/events/roomtopicevent.cpp @@ -24,6 +24,7 @@ class RoomTopicEvent::Private { public: QString topic; + QString senderId; }; RoomTopicEvent::RoomTopicEvent() @@ -37,6 +38,11 @@ RoomTopicEvent::~RoomTopicEvent() delete d; } +QString RoomTopicEvent::senderId() const +{ + return d->senderId; +} + QString RoomTopicEvent::topic() const { return d->topic; @@ -44,8 +50,9 @@ QString RoomTopicEvent::topic() const RoomTopicEvent* RoomTopicEvent::fromJson(const QJsonObject& obj) { - RoomTopicEvent* e = new RoomTopicEvent(); + auto e = new RoomTopicEvent(); e->parseJson(obj); e->d->topic = obj.value("content").toObject().value("topic").toString(); + e->d->senderId = obj["sender"].toString(); return e; } diff --git a/events/roomtopicevent.h b/events/roomtopicevent.h index 9c27339c..17b10870 100644 --- a/events/roomtopicevent.h +++ b/events/roomtopicevent.h @@ -31,6 +31,7 @@ namespace QMatrixClient RoomTopicEvent(); virtual ~RoomTopicEvent(); + QString senderId() const; QString topic() const; static RoomTopicEvent* fromJson(const QJsonObject& obj); @@ -41,4 +42,4 @@ namespace QMatrixClient }; } -#endif // QMATRIXCLIENT_ROOMTOPICEVENT_H
\ No newline at end of file +#endif // QMATRIXCLIENT_ROOMTOPICEVENT_H |