aboutsummaryrefslogtreecommitdiff
path: root/connection.cpp
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2018-01-30 15:35:06 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2018-01-30 16:07:54 +0900
commit038471e340c51f36f612fbb19d8a2b60a9923973 (patch)
tree64fd4526106f80b6a0091f6c5ad10127e73aec30 /connection.cpp
parentfcb0342410beaacc84c59813a1a7b6195c6abf7f (diff)
downloadlibquotient-038471e340c51f36f612fbb19d8a2b60a9923973.tar.gz
libquotient-038471e340c51f36f612fbb19d8a2b60a9923973.zip
Connection: expose the list of users; use an ordered map
It's still an open question whether it's better to store a separate sorted index of users, next to an unsorted one; but a sorted list of users is of much more use in GUI than an unsorted one.
Diffstat (limited to 'connection.cpp')
-rw-r--r--connection.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/connection.cpp b/connection.cpp
index 01d7461d..e06baef7 100644
--- a/connection.cpp
+++ b/connection.cpp
@@ -62,7 +62,7 @@ class Connection::Private
// Leave state of the same room.
QHash<QPair<QString, bool>, Room*> roomMap;
QVector<QString> roomIdsToForget;
- QHash<QString, User*> userMap;
+ QMap<QString, User*> userMap;
QString userId;
SyncJob* syncJob = nullptr;
@@ -516,6 +516,11 @@ QHash< QPair<QString, bool>, Room* > Connection::roomMap() const
return roomMap;
}
+QMap<QString, User*> Connection::users() const
+{
+ return d->userMap;
+}
+
const ConnectionData* Connection::connectionData() const
{
return d->data.get();