From 853fda2e7942ffb3bc8051e6411faa23cff6f3c2 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Thu, 3 May 2018 12:14:10 +0900 Subject: Cleanup --- lib/events/roommemberevent.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/events/roommemberevent.h') diff --git a/lib/events/roommemberevent.h b/lib/events/roommemberevent.h index 89b970c9..5f1e578d 100644 --- a/lib/events/roommemberevent.h +++ b/lib/events/roommemberevent.h @@ -56,12 +56,14 @@ namespace QMatrixClient using MembershipType = MemberEventContent::MembershipType; + explicit RoomMemberEvent(Type type, const QJsonObject& obj) + : StateEvent(type, obj) + { } RoomMemberEvent(MemberEventContent&& c) : StateEvent(Type::RoomMember, c) { } explicit RoomMemberEvent(const QJsonObject& obj) - : StateEvent(Type::RoomMember, obj) -// , _userId(obj["state_key"].toString()) + : RoomMemberEvent(Type::RoomMember, obj) { } MembershipType membership() const { return content().membership; } @@ -72,7 +74,6 @@ namespace QMatrixClient QUrl avatarUrl() const { return content().avatarUrl; } private: -// QString _userId; REGISTER_ENUM(MembershipType) }; } // namespace QMatrixClient -- cgit v1.2.3 From 28a0d70164e2596d306521cd18d25c0e8c0b5336 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Fri, 4 May 2018 12:13:43 +0900 Subject: EvT::TypeId: Use a member function instead of a variable The latter one causes linkage errors when used from a template method (but not from a template class, puzzlingly). --- lib/events/roommemberevent.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/events/roommemberevent.h') diff --git a/lib/events/roommemberevent.h b/lib/events/roommemberevent.h index 5f1e578d..8e0cc0a4 100644 --- a/lib/events/roommemberevent.h +++ b/lib/events/roommemberevent.h @@ -52,7 +52,7 @@ namespace QMatrixClient { Q_GADGET public: - static constexpr const char* TypeId = "m.room.member"; + static constexpr const char* typeId() { return "m.room.member"; } using MembershipType = MemberEventContent::MembershipType; -- cgit v1.2.3