File tree 1 file changed +5
-6
lines changed
1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -828,7 +828,10 @@ void Room::setReadReceipt(const QString& atEventId)
828
828
829
829
bool Room::Private::markMessagesAsRead (const rev_iter_t &upToMarker)
830
830
{
831
- if (const auto changes = setFullyReadMarker (upToMarker->event ()->id ())) {
831
+ if (upToMarker == q->historyEdge ())
832
+ qCWarning (MESSAGES) << " Cannot mark an unknown event in"
833
+ << q->objectName () << " as fully read" ;
834
+ else if (const auto changes = setFullyReadMarker (upToMarker->event ()->id ())) {
832
835
// The assumption below is that if a read receipt was sent on a newer
833
836
// event, the homeserver will keep it there instead of reverting to
834
837
// m.fully_read
@@ -837,15 +840,11 @@ bool Room::Private::markMessagesAsRead(const rev_iter_t &upToMarker)
837
840
fullyReadUntilEventId);
838
841
postprocessChanges (changes);
839
842
return true ;
840
- }
841
- if (upToMarker != q->historyEdge ())
843
+ } else
842
844
qCDebug (MESSAGES) << " Event" << *upToMarker << " in" << q->objectName ()
843
845
<< " is behind the current fully read marker at"
844
846
<< *q->fullyReadMarker ()
845
847
<< " - won't move fully read marker back in timeline" ;
846
- else
847
- qCWarning (MESSAGES) << " Cannot mark an unknown event in"
848
- << q->objectName () << " as fully read" ;
849
848
return false ;
850
849
}
851
850
You can’t perform that action at this time.
0 commit comments