diff options
author | Ram Nad <ramnad1999@gmail.com> | 2020-03-20 13:12:42 +0530 |
---|---|---|
committer | Ram Nad <ramnad1999@gmail.com> | 2020-03-20 13:12:42 +0530 |
commit | a2177b704c06bccc4840607803bca4fbe747830b (patch) | |
tree | df1758dc6458acea340ad00aa6394489fd6d1879 /lib | |
parent | c86ca8eb7f8cc4884f11be34fc71e1c4963c8ace (diff) | |
download | libquotient-a2177b704c06bccc4840607803bca4fbe747830b.tar.gz libquotient-a2177b704c06bccc4840607803bca4fbe747830b.zip |
added altAliases()
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; |