From f4fbf96e7ea5147ef2944784665671219692253d Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Thu, 30 Mar 2017 12:21:34 +0300 Subject: Fixed accidental auto-promotion when read marker is out of sight --- room.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/room.cpp b/room.cpp index 1cedab1e..55531824 100644 --- a/room.cpp +++ b/room.cpp @@ -608,9 +608,12 @@ void Room::doAddNewMessageEvents(const Events& events) // the local user, markMessagesAsRead() invocation) to promote their // read markers over the new message events. User* firstWriter = connection()->user(events.front()->senderId()); - d->promoteReadMarker(firstWriter, findInTimeline(events.front()->id())); - qDebug() << "Auto-promoted read marker for" << firstWriter->id() - << "to" << *readMarker(firstWriter); + if (readMarker(firstWriter) != timelineEdge()) + { + d->promoteReadMarker(firstWriter, findInTimeline(events.front()->id())); + qDebug() << "Auto-promoted read marker for" << firstWriter->id() + << "to" << *readMarker(firstWriter); + } if( !d->unreadMessages && newUnreadMessages > 0) { -- cgit v1.2.3