aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--room.cpp12
-rw-r--r--room.h1
2 files changed, 9 insertions, 4 deletions
diff --git a/room.cpp b/room.cpp
index 992411c0..547b74c4 100644
--- a/room.cpp
+++ b/room.cpp
@@ -371,16 +371,20 @@ QList< User* > Room::users() const
return d->membersMap.values();
}
-QStringList Room::memberNames() const {
+QStringList Room::memberNames() const
+{
QStringList res;
-
- for (auto u : d->membersMap.values()) {
+ for (auto u : d->membersMap)
res.append( this->roomMembername(u) );
- }
return res;
}
+int Room::memberCount() const
+{
+ return d->membersMap.size();
+}
+
void Room::Private::insertMemberIntoMap(User *u)
{
auto namesakes = membersMap.values(u->name());
diff --git a/room.h b/room.h
index a3eb189c..23a1412d 100644
--- a/room.h
+++ b/room.h
@@ -94,6 +94,7 @@ namespace QMatrixClient
Q_INVOKABLE QList<User*> users() const;
Q_INVOKABLE QStringList memberNames() const;
+ Q_INVOKABLE int memberCount() const;
/**
* @brief Produces a disambiguated name for a given user in