diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-03-30 12:21:34 +0300 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-03-30 12:21:34 +0300 |
commit | f4fbf96e7ea5147ef2944784665671219692253d (patch) | |
tree | 1ce01f84f1e6b8b15e8d066c2a8e261dc7dfd80d | |
parent | edaf027571106c2dedba7895d56fd4c2121a56ed (diff) | |
download | libquotient-f4fbf96e7ea5147ef2944784665671219692253d.tar.gz libquotient-f4fbf96e7ea5147ef2944784665671219692253d.zip |
Fixed accidental auto-promotion when read marker is out of sight
-rw-r--r-- | room.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -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) { |