diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-01-22 10:29:48 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-01-22 10:29:48 +0900 |
commit | 766f0cc7743724d830df30eca6899cad20ba1dc8 (patch) | |
tree | 529e1d390b42612950a6ff29d8392ca97d9f50f3 /room.cpp | |
parent | 3bfb1d9736e05fe216c016ae2dbb8eac4ac78048 (diff) | |
download | libquotient-766f0cc7743724d830df30eca6899cad20ba1dc8.tar.gz libquotient-766f0cc7743724d830df30eca6899cad20ba1dc8.zip |
Room::setLastReadEvent: don't update if the event is the same
Diffstat (limited to 'room.cpp')
-rw-r--r-- | room.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -302,7 +302,10 @@ void Room::setJoinState(JoinState state) void Room::Private::setLastReadEvent(User* u, const QString& eventId) { - lastReadEventIds.insert(u, eventId); + auto& storedId = lastReadEventIds[u]; + if (storedId == eventId) + return; + storedId = eventId; emit q->lastReadEventChanged(u); if (isLocalUser(u)) emit q->readMarkerMoved(); @@ -1151,7 +1154,7 @@ void Room::Private::checkUnreadMessages(timeline_iter_t from) const auto newUnreadMessages = count_if(from, timeline.cend(), std::bind(&Room::Private::isEventNotable, this, _1)); - // The first event in the just-added batch (referred to by upTo.base()) + // The first event in the just-added batch (referred to by `from`) // defines whose read marker can possibly be promoted any further over // the same author's events newly arrived. Others will need explicit // read receipts from the server (or, for the local user, |