aboutsummaryrefslogtreecommitdiff
path: root/lib/connection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/connection.cpp')
-rw-r--r--lib/connection.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/connection.cpp b/lib/connection.cpp
index 5bddbb83..f3d31d2d 100644
--- a/lib/connection.cpp
+++ b/lib/connection.cpp
@@ -87,7 +87,7 @@ public:
QHash<QPair<QString, bool>, Room*> roomMap;
/// Mapping from serverparts to alias/room id mappings,
/// as of the last sync
- QHash<QString, QHash<QString, QString>> roomAliasMap;
+ QHash<QString, QString> roomAliasMap;
QVector<QString> roomIdsToForget;
QVector<Room*> firstTimeRooms;
QVector<QString> pendingStateRoomIds;
@@ -891,7 +891,7 @@ Room* Connection::room(const QString& roomId, JoinStates states) const
Room* Connection::roomByAlias(const QString& roomAlias, JoinStates states) const
{
- const auto id = d->roomAliasMap.value(serverPart(roomAlias)).value(roomAlias);
+ const auto id = d->roomAliasMap.value(roomAlias);
if (!id.isEmpty())
return room(id, states);
@@ -901,17 +901,15 @@ Room* Connection::roomByAlias(const QString& roomAlias, JoinStates states) const
}
void Connection::updateRoomAliases(const QString& roomId,
- const QString& aliasServer,
const QStringList& previousRoomAliases,
const QStringList& roomAliases)
{
- auto& aliasMap = d->roomAliasMap[aliasServer]; // Allocate if necessary
for (const auto& a : previousRoomAliases)
- if (aliasMap.remove(a) == 0)
+ if (d->roomAliasMap.remove(a) == 0)
qCWarning(MAIN) << "Alias" << a << "is not found (already deleted?)";
for (const auto& a : roomAliases) {
- auto& mappedId = aliasMap[a];
+ auto& mappedId = d->roomAliasMap[a];
if (!mappedId.isEmpty()) {
if (mappedId == roomId)
qCDebug(MAIN)