From a2177b704c06bccc4840607803bca4fbe747830b Mon Sep 17 00:00:00 2001 From: Ram Nad Date: Fri, 20 Mar 2020 13:12:42 +0530 Subject: added altAliases() --- lib/room.cpp | 9 +++++++-- lib/room.h | 4 +++- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/room.cpp b/lib/room.cpp index fa3f10a6..60b36911 100644 --- a/lib/room.cpp +++ b/lib/room.cpp @@ -439,6 +439,11 @@ QStringList Room::aliases() const return result; } +QStringList Room::altAliases() const +{ + return d->getCurrentState()->altAliases(); +} + QStringList Room::localAliases() const { return d->getCurrentState( @@ -1702,7 +1707,7 @@ void Room::setName(const QString& newName) // Not sure what will be best void Room::setCanonicalAlias(const QString& newAlias) { - d->requestSetState(newAlias); + d->requestSetState(newAlias, this->altAliases()); } void Room::setLocalAliases(const QStringList& aliases) @@ -2394,7 +2399,7 @@ Room::Changes Room::processStateEvent(const RoomEvent& e) } connection()->updateRoomAliases(id(), previousAliases, newAliases); - return CanonicalAliasChange; + return AliasesChange; // clang-format off } , [] (const RoomTopicEvent&) { diff --git a/lib/room.h b/lib/room.h index 4d2527f7..d5fea94f 100644 --- a/lib/room.h +++ b/lib/room.h @@ -141,7 +141,8 @@ public: enum Change : uint { NoChange = 0x0, NameChange = 0x1, - CanonicalAliasChange = 0x2, + AliasesChange = 0x2, + CanonicalAliasChange = AliasesChange, TopicChange = 0x4, UnreadNotifsChange = 0x8, AvatarChange = 0x10, @@ -195,6 +196,7 @@ public: [[deprecated("Use aliases()")]] QStringList remoteAliases() const; QString canonicalAlias() const; + QStringList altAliases() const; QStringList aliases() const; QString displayName() const; QString topic() const; -- cgit v1.2.3