From c02174bc8f09761c2e4ee3ca4a250ce49025343e Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Mon, 29 Aug 2016 17:01:06 +0900 Subject: RoomTopicEvent: parse and provide sender information --- events/roomtopicevent.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'events/roomtopicevent.cpp') 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; } -- cgit v1.2.3