From 107b6fc4fc91d2cde3fc3d6ac4c532f1ef986e89 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sun, 10 Apr 2016 18:08:29 +0900 Subject: Store left room members as well. In particular, this will be needed to render room names according to the CS spec. --- room.cpp | 8 ++++++++ room.h | 1 + 2 files changed, 9 insertions(+) diff --git a/room.cpp b/room.cpp index c5b674ae..bf3477e3 100644 --- a/room.cpp +++ b/room.cpp @@ -59,6 +59,7 @@ class Room::Private: public QObject int notificationCount; QList users; QList usersTyping; + QList membersLeft; QHash 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); } } diff --git a/room.h b/room.h index c4993f7a..fd49f2ef 100644 --- a/room.h +++ b/room.h @@ -49,6 +49,7 @@ namespace QMatrixClient Q_INVOKABLE QString topic() const; Q_INVOKABLE JoinState joinState() const; Q_INVOKABLE QList usersTyping() const; + QList membersLeft() const; Q_INVOKABLE QList users() const; -- cgit v1.2.3