From fadd19bca495647484287eae097be5f20b2f7531 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 10 Mar 2023 11:59:05 +0400 Subject: [PATCH] Beta version 4.6.9: Fix critical loading bug. Regression was introduced in ec6dda47ae. The HistoryWidget was infinitely trying to load history down even when there was nothing to load and kept flooding with requests. --- Telegram/SourceFiles/history/history_widget.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index 22681f1b4..2c1138cc5 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -3358,8 +3358,10 @@ void HistoryWidget::loadMessagesDown() { auto loadMigrated = _migrated && !(_migrated->isEmpty() || _migrated->loadedAtBottom() || (!_history->isEmpty() && !_history->loadedAtTop())); auto from = loadMigrated ? _migrated : _history; - if (from->loadedAtBottom() && _sponsoredMessagesStateKnown) { - session().data().sponsoredMessages().request(_history, nullptr); + if (from->loadedAtBottom()) { + if (_sponsoredMessagesStateKnown) { + session().data().sponsoredMessages().request(_history, nullptr); + } return; }