mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Don't auto-send /start in blocked bots.
This commit is contained in:
parent
199e7a1d46
commit
afffdd5bbf
1 changed files with 15 additions and 8 deletions
|
@ -3599,14 +3599,19 @@ void HistoryWidget::historyLoaded() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HistoryWidget::clearMaybeSendStart() {
|
bool HistoryWidget::clearMaybeSendStart() {
|
||||||
if (!_showAndMaybeSendStart) {
|
if (!_showAndMaybeSendStart || !_history) {
|
||||||
|
return false;
|
||||||
|
} else if (!_history->peer->isFullLoaded()) {
|
||||||
|
_history->peer->updateFull();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
_showAndMaybeSendStart = false;
|
_showAndMaybeSendStart = false;
|
||||||
if (const auto user = _history ? _history->peer->asUser() : nullptr) {
|
if (const auto user = _history ? _history->peer->asUser() : nullptr) {
|
||||||
if (const auto info = user->botInfo.get()) {
|
if (user->blockStatus() == PeerData::BlockStatus::NotBlocked) {
|
||||||
if (!info->startToken.isEmpty()) {
|
if (const auto info = user->botInfo.get()) {
|
||||||
return true;
|
if (!info->startToken.isEmpty()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3975,10 +3980,8 @@ void HistoryWidget::preloadHistoryIfNeeded() {
|
||||||
preloadHistoryByScroll();
|
preloadHistoryByScroll();
|
||||||
checkReplyReturns();
|
checkReplyReturns();
|
||||||
}
|
}
|
||||||
if (_history && _history->loadedAtTop() && _history->loadedAtBottom()) {
|
if (clearMaybeSendStart() && !_history->isDisplayedEmpty()) {
|
||||||
if (clearMaybeSendStart() && !_history->isDisplayedEmpty()) {
|
sendBotStartCommand();
|
||||||
sendBotStartCommand();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8307,6 +8310,10 @@ void HistoryWidget::fullInfoUpdated() {
|
||||||
|
|
||||||
handlePeerUpdate();
|
handlePeerUpdate();
|
||||||
checkSuggestToGigagroup();
|
checkSuggestToGigagroup();
|
||||||
|
|
||||||
|
if (clearMaybeSendStart() && !_history->isDisplayedEmpty()) {
|
||||||
|
sendBotStartCommand();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (updateCmdStartShown()) {
|
if (updateCmdStartShown()) {
|
||||||
refresh = true;
|
refresh = true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue