aboutsummaryrefslogtreecommitdiff
path: root/events
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2018-02-27 11:40:03 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2018-03-24 15:06:31 +0900
commit4e31b0371cea6441dc4281aaa28a9b693a751454 (patch)
tree2ac73a02fc3e59649ab1ced4613611bcc5f3ff8f /events
parent08fb435749f33ee5d266bbc2ea63c7c42169be97 (diff)
downloadlibquotient-4e31b0371cea6441dc4281aaa28a9b693a751454.tar.gz
libquotient-4e31b0371cea6441dc4281aaa28a9b693a751454.zip
MemberEventContent/RoomMemberEvent: parse and expose is_direct
Diffstat (limited to 'events')
-rw-r--r--events/roommemberevent.cpp1
-rw-r--r--events/roommemberevent.h2
2 files changed, 3 insertions, 0 deletions
diff --git a/events/roommemberevent.cpp b/events/roommemberevent.cpp
index a9e301a4..76b003c2 100644
--- a/events/roommemberevent.cpp
+++ b/events/roommemberevent.cpp
@@ -51,6 +51,7 @@ namespace QMatrixClient
MemberEventContent::MemberEventContent(const QJsonObject& json)
: membership(fromJson<MembershipType>(json["membership"]))
+ , isDirect(json["is_direct"].toBool())
, displayName(json["displayname"].toString())
, avatarUrl(json["avatar_url"].toString())
{ }
diff --git a/events/roommemberevent.h b/events/roommemberevent.h
index b9ff0d70..89b970c9 100644
--- a/events/roommemberevent.h
+++ b/events/roommemberevent.h
@@ -38,6 +38,7 @@ namespace QMatrixClient
explicit MemberEventContent(const QJsonObject& json);
MembershipType membership;
+ bool isDirect = false;
QString displayName;
QUrl avatarUrl;
@@ -66,6 +67,7 @@ namespace QMatrixClient
MembershipType membership() const { return content().membership; }
QString userId() const
{ return originalJsonObject().value("state_key").toString(); }
+ bool isDirect() const { return content().isDirect; }
QString displayName() const { return content().displayName; }
QUrl avatarUrl() const { return content().avatarUrl; }