diff options
Diffstat (limited to 'lib/events/roommemberevent.h')
-rw-r--r-- | lib/events/roommemberevent.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/events/roommemberevent.h b/lib/events/roommemberevent.h index a837b026..c1015df2 100644 --- a/lib/events/roommemberevent.h +++ b/lib/events/roommemberevent.h @@ -63,8 +63,14 @@ public: explicit RoomMemberEvent(const QJsonObject& obj) : StateEvent(typeId(), obj) {} - RoomMemberEvent(MemberEventContent&& c) - : StateEvent(typeId(), matrixTypeId(), c) + [[deprecated("Use RoomMemberEvent(userId, contentArgs) " + "instead")]] RoomMemberEvent(MemberEventContent&& c) + : StateEvent(typeId(), matrixTypeId(), QString(), c) + {} + template <typename... ArgTs> + RoomMemberEvent(const QString& userId, ArgTs&&... contentArgs) + : StateEvent(typeId(), matrixTypeId(), userId, + std::forward<ArgTs>(contentArgs)...) {} /// A special constructor to create unknown RoomMemberEvents @@ -82,7 +88,7 @@ public: {} MembershipType membership() const { return content().membership; } - QString userId() const { return fullJson()["state_key"_ls].toString(); } + QString userId() const { return fullJson()[StateKeyKeyL].toString(); } bool isDirect() const { return content().isDirect; } QString displayName() const { return content().displayName; } QUrl avatarUrl() const { return content().avatarUrl; } |