aboutsummaryrefslogtreecommitdiff
path: root/lib/events
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2018-12-08 15:24:45 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2018-12-08 16:25:23 +0900
commit1414f3b5cc2bca3a3871bfe569510c1a422629fe (patch)
tree1863be293cefa7afdcc91a79b03cbffdb36bbcbc /lib/events
parent1de8d511251163ed35e0647c70c3e94e071b2fe0 (diff)
downloadlibquotient-1414f3b5cc2bca3a3871bfe569510c1a422629fe.tar.gz
libquotient-1414f3b5cc2bca3a3871bfe569510c1a422629fe.zip
RoomMemberEvent: cleanup
Don't make JSON for event content only to parse it again; drop extraneous constructs.
Diffstat (limited to 'lib/events')
-rw-r--r--lib/events/roommemberevent.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/events/roommemberevent.h b/lib/events/roommemberevent.h
index db25d026..149d74f8 100644
--- a/lib/events/roommemberevent.h
+++ b/lib/events/roommemberevent.h
@@ -29,13 +29,10 @@ namespace QMatrixClient
enum MembershipType : size_t { Invite = 0, Join, Knock, Leave, Ban,
Undefined };
- explicit MemberEventContent(MembershipType mt = MembershipType::Join)
+ explicit MemberEventContent(MembershipType mt = Join)
: membership(mt)
{ }
explicit MemberEventContent(const QJsonObject& json);
- explicit MemberEventContent(const QJsonValue& jv)
- : MemberEventContent(jv.toObject())
- { }
MembershipType membership;
bool isDirect = false;
@@ -60,7 +57,7 @@ namespace QMatrixClient
: StateEvent(typeId(), obj)
{ }
RoomMemberEvent(MemberEventContent&& c)
- : StateEvent(typeId(), matrixTypeId(), c.toJson())
+ : StateEvent(typeId(), matrixTypeId(), c)
{ }
// This is a special constructor enabling RoomMemberEvent to be