aboutsummaryrefslogtreecommitdiff
path: root/events/roomtopicevent.cpp
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2016-08-29 17:01:06 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2016-08-29 17:01:06 +0900
commitc02174bc8f09761c2e4ee3ca4a250ce49025343e (patch)
tree87802eb96677409632489d0eae50d892f2cc634f /events/roomtopicevent.cpp
parentb9423ed655787db3febe5af4f6ff531969e6abb9 (diff)
downloadlibquotient-c02174bc8f09761c2e4ee3ca4a250ce49025343e.tar.gz
libquotient-c02174bc8f09761c2e4ee3ca4a250ce49025343e.zip
RoomTopicEvent: parse and provide sender information
Diffstat (limited to 'events/roomtopicevent.cpp')
-rw-r--r--events/roomtopicevent.cpp9
1 files changed, 8 insertions, 1 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;
}