diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-03-06 17:34:06 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-03-06 17:34:06 +0900 |
commit | bcbdf7e418de975c43a0bd4bd8ecbeabd2f4ca0d (patch) | |
tree | bc06a7514ca0cf3af60eeedcca8d570b516c58b5 /room.cpp | |
parent | bc10ecd90b0bda973658db419bca88923b436ff3 (diff) | |
download | libquotient-bcbdf7e418de975c43a0bd4bd8ecbeabd2f4ca0d.tar.gz libquotient-bcbdf7e418de975c43a0bd4bd8ecbeabd2f4ca0d.zip |
Make sure the read marker is reinstated after Quaternion restart
Diffstat (limited to 'room.cpp')
-rw-r--r-- | room.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -1472,9 +1472,9 @@ void Room::processEphemeralEvent(EventPtr event) << "as read for" << p.receipts.size() << "users"; } - if (d->eventsIndex.contains(p.evtId)) + const auto newMarker = findInTimeline(p.evtId); + if (newMarker != timelineEdge()) { - const auto newMarker = findInTimeline(p.evtId); for( const Receipt& r: p.receipts ) { auto u = user(r.userId); @@ -1536,7 +1536,11 @@ void Room::processAccountDataEvent(EventPtr event) d->unreadMessages = rmEvent->contentJson().value(UnreadMsgsKey).toBool(); d->serverReadMarker = readEventId; - markMessagesAsRead(readEventId); + const auto newMarker = findInTimeline(readEventId); + if (newMarker != timelineEdge()) + d->markMessagesAsRead(newMarker); + else + d->setLastReadEvent(localUser(), readEventId); break; } default: |