diff options
Diffstat (limited to 'lib/room.cpp')
-rw-r--r-- | lib/room.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/room.cpp b/lib/room.cpp index 18b06b7d..869a81c8 100644 --- a/lib/room.cpp +++ b/lib/room.cpp @@ -103,6 +103,7 @@ class Room::Private int notificationCount = 0; members_map_t membersMap; QList<User*> usersTyping; + QMultiHash<QString, User*> eventIdReadUsers; QList<User*> membersLeft; int unreadMessages = 0; bool displayed = false; @@ -375,8 +376,11 @@ void Room::Private::setLastReadEvent(User* u, QString eventId) auto& storedId = lastReadEventIds[u]; if (storedId == eventId) return; + eventIdReadUsers.remove(storedId, u); + eventIdReadUsers.insert(eventId, u); swap(storedId, eventId); emit q->lastReadEventChanged(u); + emit q->readMarkerForUserMoved(u, eventId, storedId); if (isLocalUser(u)) { if (storedId != serverReadMarker) @@ -635,6 +639,10 @@ QString Room::readMarkerEventId() const return d->lastReadEventIds.value(localUser()); } +QList<User*> Room::usersAtEventId(const QString& eventId) { + return d->eventIdReadUsers.values(eventId); +} + int Room::notificationCount() const { return d->notificationCount; |