Don't auto-submit /start on non-loaded history.

This commit is contained in:
John Preston 2025-01-28 17:59:54 +04:00
parent 2729bcac3b
commit e46d5a86d3

View file

@ -4042,7 +4042,10 @@ void HistoryWidget::preloadHistoryIfNeeded() {
preloadHistoryByScroll();
checkReplyReturns();
}
if (clearMaybeSendStart() && !_history->isDisplayedEmpty()) {
const auto hasNonEmpty = _history->findFirstNonEmpty();
const auto readyForBotStart = hasNonEmpty
|| (_history->loadedAtTop() && _history->loadedAtBottom());
if (readyForBotStart && clearMaybeSendStart() && hasNonEmpty) {
sendBotStartCommand();
}
}
@ -8373,7 +8376,10 @@ void HistoryWidget::fullInfoUpdated() {
handlePeerUpdate();
checkSuggestToGigagroup();
if (clearMaybeSendStart() && !_history->isDisplayedEmpty()) {
const auto hasNonEmpty = _history->findFirstNonEmpty();
const auto readyForBotStart = hasNonEmpty
|| (_history->loadedAtTop() && _history->loadedAtBottom());
if (readyForBotStart && clearMaybeSendStart() && hasNonEmpty) {
sendBotStartCommand();
}