aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2017-03-30 12:21:34 +0300
committerKitsune Ral <Kitsune-Ral@users.sf.net>2017-03-30 12:21:34 +0300
commitf4fbf96e7ea5147ef2944784665671219692253d (patch)
tree1ce01f84f1e6b8b15e8d066c2a8e261dc7dfd80d
parentedaf027571106c2dedba7895d56fd4c2121a56ed (diff)
downloadlibquotient-f4fbf96e7ea5147ef2944784665671219692253d.tar.gz
libquotient-f4fbf96e7ea5147ef2944784665671219692253d.zip
Fixed accidental auto-promotion when read marker is out of sight
-rw-r--r--room.cpp9
1 files 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)
{