aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2020-03-26 09:25:20 +0100
committerKitsune Ral <Kitsune-Ral@users.sf.net>2020-03-26 09:26:25 +0100
commitef59622e3506c7d234c1fff7dea1aa921f965e25 (patch)
tree3ec8e79eef86c45e5f55c62a930420a6647ade19 /lib
parent89573ca2a1c19d79c1417e64613f1a0fa696837c (diff)
downloadlibquotient-ef59622e3506c7d234c1fff7dea1aa921f965e25.tar.gz
libquotient-ef59622e3506c7d234c1fff7dea1aa921f965e25.zip
Room::aliases(): don't add canonical alias if it's empty
Fixes #394.
Diffstat (limited to 'lib')
-rw-r--r--lib/room.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/room.cpp b/lib/room.cpp
index 6ac2673e..43a42492 100644
--- a/lib/room.cpp
+++ b/lib/room.cpp
@@ -523,7 +523,10 @@ QString Room::name() const
QStringList Room::aliases() const
{
const auto* evt = d->getCurrentState<RoomCanonicalAliasEvent>();
- return QStringList(evt->altAliases()) << evt->alias();
+ auto result = evt->altAliases();
+ if (!evt->alias().isEmpty())
+ result << evt->alias();
+ return result;
}
QStringList Room::altAliases() const