diff --git a/Telegram/SourceFiles/inline_bots/bot_attach_web_view.cpp b/Telegram/SourceFiles/inline_bots/bot_attach_web_view.cpp index fca245fedd..c8c9ec3161 100644 --- a/Telegram/SourceFiles/inline_bots/bot_attach_web_view.cpp +++ b/Telegram/SourceFiles/inline_bots/bot_attach_web_view.cpp @@ -1151,8 +1151,13 @@ void AttachWebView::requestSimple(const WebViewButton &button) { )).done([=](const MTPSimpleWebViewResult &result) { _requestId = 0; result.match([&](const MTPDsimpleWebViewResultUrl &data) { - const auto queryId = uint64(); - show(queryId, qs(data.vurl()), button.text); + show( + uint64(), + qs(data.vurl()), + button.text, + false, + nullptr, + button.fromMainMenu); }); }).fail([=](const MTP::Error &error) { _requestId = 0; @@ -1396,7 +1401,8 @@ void AttachWebView::show( const QString &url, const QString &buttonText, bool allowClipboardRead, - const BotAppData *app) { + const BotAppData *app, + bool fromMainMenu) { Expects(_bot != nullptr && _context != nullptr); auto title = Info::Profile::NameValue(_bot); @@ -1413,7 +1419,8 @@ void AttachWebView::show( && !attached->inactive && attached->hasSettings); const auto hasOpenBot = !_context - || (_bot != _context->action.history->peer); + || (_bot != _context->action.history->peer) + || fromMainMenu; const auto hasRemoveFromMenu = !app && (attached != end(_attachBots)) && (!attached->inactive || attached->inMainMenu); diff --git a/Telegram/SourceFiles/inline_bots/bot_attach_web_view.h b/Telegram/SourceFiles/inline_bots/bot_attach_web_view.h index c0216b9431..f08f68027f 100644 --- a/Telegram/SourceFiles/inline_bots/bot_attach_web_view.h +++ b/Telegram/SourceFiles/inline_bots/bot_attach_web_view.h @@ -215,7 +215,8 @@ private: const QString &url, const QString &buttonText = QString(), bool allowClipboardRead = false, - const BotAppData *app = nullptr); + const BotAppData *app = nullptr, + bool fromMainMenu = false); void confirmAddToMenu( AttachWebViewBot bot, Fn callback = nullptr);