diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2016-04-10 18:08:29 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2016-05-02 19:11:08 +0900 |
commit | 107b6fc4fc91d2cde3fc3d6ac4c532f1ef986e89 (patch) | |
tree | c09aff5984d506260c533f23658d3dbf2ef0924e | |
parent | fb45e26b8ba9b5495e723cded3b6420b20b39b37 (diff) | |
download | libquotient-107b6fc4fc91d2cde3fc3d6ac4c532f1ef986e89.tar.gz libquotient-107b6fc4fc91d2cde3fc3d6ac4c532f1ef986e89.zip |
Store left room members as well.
In particular, this will be needed to render room names according to the CS spec.
-rw-r--r-- | room.cpp | 8 | ||||
-rw-r--r-- | room.h | 1 |
2 files changed, 9 insertions, 0 deletions
@@ -59,6 +59,7 @@ class Room::Private: public QObject int notificationCount; QList<User*> users; QList<User*> usersTyping; + QList<User*> membersLeft; QHash<User*, QString> lastReadEvent; QString prevBatch; bool gettingNewContent; @@ -194,6 +195,11 @@ QList< User* > Room::usersTyping() const return d->usersTyping; } +QList< User* > Room::membersLeft() const +{ + return d->membersLeft; +} + QList< User* > Room::users() const { return d->users; @@ -336,6 +342,8 @@ void Room::processStateEvent(Event* event) and d->users.contains(u) ) { d->users.removeAll(u); + if ( !d->membersLeft.contains(u) ) + d->membersLeft.append(u); emit userRemoved(u); } } @@ -49,6 +49,7 @@ namespace QMatrixClient Q_INVOKABLE QString topic() const; Q_INVOKABLE JoinState joinState() const; Q_INVOKABLE QList<User*> usersTyping() const; + QList<User*> membersLeft() const; Q_INVOKABLE QList<User*> users() const; |