diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/room.cpp | 9 | ||||
-rw-r--r-- | lib/room.h | 4 |
2 files changed, 10 insertions, 3 deletions
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<RoomCanonicalAliasEvent>()->altAliases(); +} + QStringList Room::localAliases() const { return d->getCurrentState<RoomAliasesEvent>( @@ -1702,7 +1707,7 @@ void Room::setName(const QString& newName) // Not sure what will be best void Room::setCanonicalAlias(const QString& newAlias) { - d->requestSetState<RoomCanonicalAliasEvent>(newAlias); + d->requestSetState<RoomCanonicalAliasEvent>(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&) { @@ -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; |