From 1316d14f7aef7440cd0ec1452b9da588db4dcffd Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 7 Nov 2022 15:27:07 +0400 Subject: [PATCH] Fix reading of comments. Fixes #25276. --- Telegram/SourceFiles/data/data_replies_list.cpp | 6 +++--- .../SourceFiles/history/view/history_view_list_widget.cpp | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Telegram/SourceFiles/data/data_replies_list.cpp b/Telegram/SourceFiles/data/data_replies_list.cpp index 28d489e68b..3263c788af 100644 --- a/Telegram/SourceFiles/data/data_replies_list.cpp +++ b/Telegram/SourceFiles/data/data_replies_list.cpp @@ -935,15 +935,15 @@ void RepliesList::readTill(not_null item) { } void RepliesList::readTill(MsgId tillId) { - if (!IsServerMsgId(tillId)) { - return; - } readTill(tillId, _history->owner().message(_history->peer->id, tillId)); } void RepliesList::readTill( MsgId tillId, HistoryItem *tillIdItem) { + if (!IsServerMsgId(tillId)) { + return; + } const auto was = computeInboxReadTillFull(); const auto now = tillId; if (now < was) { diff --git a/Telegram/SourceFiles/history/view/history_view_list_widget.cpp b/Telegram/SourceFiles/history/view/history_view_list_widget.cpp index 10a7d442e7..74e95d1634 100644 --- a/Telegram/SourceFiles/history/view/history_view_list_widget.cpp +++ b/Telegram/SourceFiles/history/view/history_view_list_widget.cpp @@ -1962,7 +1962,11 @@ void ListWidget::checkActivation() { for (const auto &view : ranges::views::reverse(_items)) { const auto bottom = itemTop(view) + view->height(); if (_visibleBottom + _itemsRevealHeight >= bottom) { - delegate()->listMarkReadTill(view->data()); + const auto item = view->data(); + if (item->isRegular()) { + delegate()->listMarkReadTill(item); + return; + } } } }