diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/room.cpp | 12 | ||||
-rw-r--r-- | lib/room.h | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/room.cpp b/lib/room.cpp index af6ef8c4..bfa6df68 100644 --- a/lib/room.cpp +++ b/lib/room.cpp @@ -192,7 +192,7 @@ class Room::Private */ void dropDuplicateEvents(RoomEvents& events) const; - void setLastReadEvent(User* u, const QString& eventId); + void setLastReadEvent(User* u, QString eventId); void updateUnreadCount(rev_iter_t from, rev_iter_t to); void promoteReadMarker(User* u, rev_iter_t newMarker, bool force = false); @@ -374,18 +374,18 @@ void Room::setJoinState(JoinState state) emit joinStateChanged(oldState, state); } -void Room::Private::setLastReadEvent(User* u, const QString& eventId) +void Room::Private::setLastReadEvent(User* u, QString eventId) { auto& storedId = lastReadEventIds[u]; if (storedId == eventId) return; - storedId = eventId; + swap(storedId, eventId); emit q->lastReadEventChanged(u); if (isLocalUser(u)) { - if (eventId != serverReadMarker) - connection->callApi<PostReadMarkersJob>(id, eventId); - emit q->readMarkerMoved(); + if (storedId != serverReadMarker) + connection->callApi<PostReadMarkersJob>(id, storedId); + emit q->readMarkerMoved(eventId, storedId); } } @@ -423,7 +423,7 @@ namespace QMatrixClient void firstDisplayedEventChanged(); void lastDisplayedEventChanged(); void lastReadEventChanged(User* user); - void readMarkerMoved(); + void readMarkerMoved(QString fromEventId, QString toEventId); void unreadMessagesChanged(Room* room); void accountDataChanged(QString type); |