diff options
author | Roman Plášil <me@rplasil.name> | 2017-02-13 09:24:52 +0800 |
---|---|---|
committer | Roman Plášil <me@rplasil.name> | 2017-06-02 16:36:02 +0800 |
commit | 6aef84109f68e07d71432d5bb8437e33eaeed940 (patch) | |
tree | 83fb9b5b21aa5ef8f3cf4631055850f9824d2946 | |
parent | 67b75e13db0d9b201c92d74e829e45d043313be7 (diff) | |
download | libquotient-6aef84109f68e07d71432d5bb8437e33eaeed940.tar.gz libquotient-6aef84109f68e07d71432d5bb8437e33eaeed940.zip |
Add Room::memberNames() for nick completion in QML
-rw-r--r-- | room.cpp | 10 | ||||
-rw-r--r-- | room.h | 1 |
2 files changed, 11 insertions, 0 deletions
@@ -370,6 +370,16 @@ QList< User* > Room::users() const return d->membersMap.values(); } +QStringList Room::memberNames() const { + QStringList res; + + for (auto u : d->membersMap.values()) { + res.append( this->roomMembername(u) ); + } + + return res; +} + void Room::Private::insertMemberIntoMap(User *u) { auto namesakes = membersMap.values(u->name()); @@ -90,6 +90,7 @@ namespace QMatrixClient QList<User*> membersLeft() const; Q_INVOKABLE QList<User*> users() const; + Q_INVOKABLE QStringList memberNames() const; /** * @brief Produces a disambiguated name for a given user in |