2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-04 16:35:44 +00:00

Support ?startapp=value start_param passing.

This commit is contained in:
John Preston
2023-09-15 15:34:43 +04:00
parent b17b806d91
commit c12743925e
4 changed files with 49 additions and 25 deletions

View File

@@ -578,6 +578,14 @@ void SessionNavigation::showPeerByLinkResolved(
attachBotUsername,
info.attachBotToggleCommand.value_or(QString()));
});
} else if (bot && info.attachBotMenuOpen) {
const auto startCommand = info.attachBotToggleCommand.value_or(
QString());
bot->session().attachWebView().requestAddToMenu(
bot,
InlineBots::AddToMenuOpenMenu{ startCommand },
parentController(),
std::optional<Api::SendAction>());
} else if (bot && info.attachBotToggleCommand) {
const auto itemId = info.clickFromMessageId;
const auto item = _session->data().message(itemId);
@@ -598,12 +606,6 @@ void SessionNavigation::showPeerByLinkResolved(
? Api::SendAction(
contextUser->owner().history(contextUser))
: std::optional<Api::SendAction>()));
} else if (bot && info.attachBotMenuOpen) {
bot->session().attachWebView().requestAddToMenu(
bot,
InlineBots::AddToMenuOpenMenu(),
parentController(),
std::optional<Api::SendAction>());
} else {
crl::on_main(this, [=] {
showPeerHistory(peer, params, msgId);