diff --git a/Telegram/SourceFiles/data/data_replies_list.cpp b/Telegram/SourceFiles/data/data_replies_list.cpp index 492db196ed..dedcb57f27 100644 --- a/Telegram/SourceFiles/data/data_replies_list.cpp +++ b/Telegram/SourceFiles/data/data_replies_list.cpp @@ -860,7 +860,13 @@ std::optional RepliesList::computeUnreadCountLocally( MsgId afterId) const { Expects(afterId >= _inboxReadTillId); - const auto wasUnreadCountAfter = _unreadCount.current(); + const auto currentUnreadCountAfter = _unreadCount.current(); + const auto startingMarkingAsRead = (currentUnreadCountAfter == 0) + && (_inboxReadTillId == 1) + && (afterId > 1); + const auto wasUnreadCountAfter = startingMarkingAsRead + ? _fullCount.current().value_or(0) + : currentUnreadCountAfter; const auto readTillId = std::max(afterId, _rootId); const auto wasReadTillId = _inboxReadTillId; const auto backLoaded = (_skippedBefore == 0);