diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-12-08 15:24:45 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-12-08 16:25:23 +0900 |
commit | 1414f3b5cc2bca3a3871bfe569510c1a422629fe (patch) | |
tree | 1863be293cefa7afdcc91a79b03cbffdb36bbcbc /lib/events | |
parent | 1de8d511251163ed35e0647c70c3e94e071b2fe0 (diff) | |
download | libquotient-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.h | 7 |
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 |