aboutsummaryrefslogtreecommitdiff
path: root/lib/user.cpp
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2020-03-26 22:49:06 +0100
committerKitsune Ral <Kitsune-Ral@users.sf.net>2020-03-26 22:52:01 +0100
commit2216c5f844e5227976f4b0a8208c6c7e834934ae (patch)
tree485f087033ef9789d0c8469538ee62ec1ff1336f /lib/user.cpp
parent123d58fc3c29d8e9adbb5b654df53d5cbb0a32fa (diff)
downloadlibquotient-2216c5f844e5227976f4b0a8208c6c7e834934ae.tar.gz
libquotient-2216c5f844e5227976f4b0a8208c6c7e834934ae.zip
Connection: allRooms(), rooms(), roomsCount(); deprecate roomMap()
Backport of #354.
Diffstat (limited to 'lib/user.cpp')
-rw-r--r--lib/user.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/user.cpp b/lib/user.cpp
index 535551cf..c51354a0 100644
--- a/lib/user.cpp
+++ b/lib/user.cpp
@@ -118,8 +118,7 @@ void User::Private::setNameForRoom(const Room* r, QString newName,
et.start();
}
- const auto& roomMap = connection->roomMap();
- for (auto* r1: roomMap)
+ for (auto* r1: connection->allRooms())
if (nameForRoom(r1) == mostUsedName)
otherNames.insert(mostUsedName, r1);
@@ -186,8 +185,7 @@ void User::Private::setAvatarForRoom(const Room* r, const QUrl& newUrl,
nextMostUsedIt = otherAvatars.end() - 1;
}
std::swap(mostUsedAvatar, *nextMostUsedIt);
- const auto& roomMap = connection->roomMap();
- for (const auto* r1: roomMap)
+ for (const auto* r1: connection->allRooms())
if (avatarUrlForRoom(r1) == nextMostUsedIt->url())
avatarsToRooms.insert(nextMostUsedIt->url(), r1);