diff options
author | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2021-11-11 08:27:42 +0100 |
---|---|---|
committer | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2021-11-11 08:27:42 +0100 |
commit | 766410a6c9e928915ece112f4f4f4a4317789e5f (patch) | |
tree | 95cb911222a51718fd27c788c0a83805c75aa33f /lib/events | |
parent | 5c0346f3a700e6af31463490b7af3382b86e09d5 (diff) | |
parent | 65bb0b5fcf029df7a9bfa0b7b7b7e3203fd7862f (diff) | |
download | libquotient-766410a6c9e928915ece112f4f4f4a4317789e5f.tar.gz libquotient-766410a6c9e928915ece112f4f4f4a4317789e5f.zip |
Merge branch 'dev' into kitsune-fix-read-receipts-and-markers
Diffstat (limited to 'lib/events')
-rw-r--r-- | lib/events/event.h | 3 | ||||
-rw-r--r-- | lib/events/roommemberevent.cpp | 14 |
2 files changed, 7 insertions, 10 deletions
diff --git a/lib/events/event.h b/lib/events/event.h index f8f8311d..78853ced 100644 --- a/lib/events/event.h +++ b/lib/events/event.h @@ -76,8 +76,7 @@ public: private: EventTypeRegistry() = default; - Q_DISABLE_COPY(EventTypeRegistry) - DISABLE_MOVE(EventTypeRegistry) + Q_DISABLE_COPY_MOVE(EventTypeRegistry) static EventTypeRegistry& get() { diff --git a/lib/events/roommemberevent.cpp b/lib/events/roommemberevent.cpp index 8a6bddd8..469dbb32 100644 --- a/lib/events/roommemberevent.cpp +++ b/lib/events/roommemberevent.cpp @@ -103,16 +103,14 @@ bool RoomMemberEvent::isUnban() const bool RoomMemberEvent::isRename() const { - auto prevName = prevContent() && prevContent()->displayName - ? *prevContent()->displayName - : QString(); - return newDisplayName() != prevName; + return prevContent() && prevContent()->displayName + ? newDisplayName() != *prevContent()->displayName + : newDisplayName().has_value(); } bool RoomMemberEvent::isAvatarUpdate() const { - auto prevAvatarUrl = prevContent() && prevContent()->avatarUrl - ? *prevContent()->avatarUrl - : QUrl(); - return newAvatarUrl() != prevAvatarUrl; + return prevContent() && prevContent()->avatarUrl + ? newAvatarUrl() != *prevContent()->avatarUrl + : newAvatarUrl().has_value(); } |