Fix reading of comments.

Fixes #25276.
This commit is contained in:
John Preston 2022-11-07 15:27:07 +04:00
parent 0737034ea6
commit 1316d14f7a
2 changed files with 8 additions and 4 deletions

View File

@ -935,15 +935,15 @@ void RepliesList::readTill(not_null<HistoryItem*> 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) {

View File

@ -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;
}
}
}
}