diff --git a/Telegram/SourceFiles/inline_bots/bot_attach_web_view.cpp b/Telegram/SourceFiles/inline_bots/bot_attach_web_view.cpp index 3f549edb1..80a2dbdbb 100644 --- a/Telegram/SourceFiles/inline_bots/bot_attach_web_view.cpp +++ b/Telegram/SourceFiles/inline_bots/bot_attach_web_view.cpp @@ -64,6 +64,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include +// AyuGram includes +#include "ayu/ayu_settings.h" + + namespace InlineBots { namespace { @@ -513,6 +517,11 @@ void BotAction::handleKeyPress(not_null e) { } } +QString WebviewPlatform() { + const auto settings = &AyuSettings::getInstance(); + return settings->spoofWebviewAsAndroid ? "android" : "tdesktop"; +} + } // namespace base::weak_ptr WebViewInstance::PendingActivation; @@ -843,7 +852,7 @@ void WebViewInstance::requestButton() { MTP_bytes(_button.url), MTP_string(_button.startCommand), MTP_dataJSON(MTP_bytes(botThemeParams().json)), - MTP_string("tdesktop"), + MTP_string(WebviewPlatform()), action.mtpReplyTo(), (action.options.sendAs ? action.options.sendAs->input @@ -876,7 +885,7 @@ void WebViewInstance::requestSimple() { MTP_bytes(_button.url), MTP_string(_button.startCommand), MTP_dataJSON(MTP_bytes(botThemeParams().json)), - MTP_string("tdesktop") + MTP_string(WebviewPlatform()) )).done([=](const MTPWebViewResult &result) { show(qs(result.data().vurl())); }).fail([=](const MTP::Error &error) { @@ -901,7 +910,7 @@ void WebViewInstance::requestMain() { _bot->inputUser, MTP_string(_button.startCommand), MTP_dataJSON(MTP_bytes(botThemeParams().json)), - MTP_string("tdesktop") + MTP_string(WebviewPlatform()) )).done([=](const MTPWebViewResult &result) { show(qs(result.data().vurl())); }).fail([=](const MTP::Error &error) { @@ -925,7 +934,7 @@ void WebViewInstance::requestApp(bool allowWrite) { MTP_inputBotAppID(MTP_long(app->id), MTP_long(app->accessHash)), MTP_string(_appStartParam), MTP_dataJSON(MTP_bytes(botThemeParams().json)), - MTP_string("tdesktop") + MTP_string(WebviewPlatform()) )).done([=](const MTPWebViewResult &result) { _requestId = 0; show(qs(result.data().vurl())); diff --git a/Telegram/lib_ui b/Telegram/lib_ui index ebe1b4bbc..7f2817b4b 160000 --- a/Telegram/lib_ui +++ b/Telegram/lib_ui @@ -1 +1 @@ -Subproject commit ebe1b4bbc729261e83e163a5c21da9959bcc9d13 +Subproject commit 7f2817b4b9f0894eedd42922ab439e0e04221b40