diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2020-11-15 21:51:51 +0100 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2020-11-15 21:51:51 +0100 |
commit | 52cab4b11bdd48cd87e04c01b12c698ec4145e6d (patch) | |
tree | f8b44dd9c585606b4ac229c396ef914d5950fd47 /lib/events/roommemberevent.h | |
parent | 5b1bfc102fccd4e57893b34bf2b0a14ba6a9f577 (diff) | |
download | libquotient-52cab4b11bdd48cd87e04c01b12c698ec4145e6d.tar.gz libquotient-52cab4b11bdd48cd87e04c01b12c698ec4145e6d.zip |
Cleanup across event classes
In particular: removed unnecessary #includes, deprecated and no more
used constructs, replaced stored members with dynamic generation
from JSON (TypingEvent and, especially promising for performance,
ReceiptEvent)
Diffstat (limited to 'lib/events/roommemberevent.h')
-rw-r--r-- | lib/events/roommemberevent.h | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/events/roommemberevent.h b/lib/events/roommemberevent.h index 35fd69a9..cebaaf10 100644 --- a/lib/events/roommemberevent.h +++ b/lib/events/roommemberevent.h @@ -54,13 +54,10 @@ public: DEFINE_EVENT_TYPEID("m.room.member", RoomMemberEvent) using MembershipType = MemberEventContent::MembershipType; + Q_ENUM(MembershipType) explicit RoomMemberEvent(const QJsonObject& obj) : StateEvent(typeId(), obj) {} - [[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, @@ -82,7 +79,7 @@ public: {} MembershipType membership() const { return content().membership; } - QString userId() const { return fullJson()[StateKeyKeyL].toString(); } + QString userId() const { return stateKey(); } bool isDirect() const { return content().isDirect; } Omittable<QString> newDisplayName() const { return content().displayName; } Omittable<QUrl> newAvatarUrl() const { return content().avatarUrl; } @@ -104,9 +101,6 @@ public: bool isLeave() const; bool isRename() const; bool isAvatarUpdate() const; - -private: - Q_ENUM(MembershipType) }; template <> |