From fb283c4828f8a06f2e5b101db2696e23d37c3ee6 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 6 Feb 2023 09:12:06 +0400 Subject: [PATCH] Fix bot buttons disappearing on chat switch. --- Telegram/SourceFiles/history/history_widget.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index d4d381c2a5..7b33b4538a 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -4058,6 +4058,7 @@ void HistoryWidget::showFinished() { void HistoryWidget::doneShow() { _topBar->setAnimatingMode(false); + updateCanSendMessage(); updateBotKeyboard(); updateControlsVisibility(); if (!_historyInited) { @@ -7362,6 +7363,9 @@ void HistoryWidget::handlePeerUpdate() { } bool HistoryWidget::updateCanSendMessage() { + if (!_peer) { + return false; + } const auto replyTo = (_replyToId && !_editMsgId) ? _replyEditMsg : 0; const auto topic = replyTo ? replyTo->topic() : nullptr; const auto allWithoutPolls = Data::AllSendRestrictions()