diff --git a/Telegram/SourceFiles/inline_bots/bot_attach_web_view.cpp b/Telegram/SourceFiles/inline_bots/bot_attach_web_view.cpp index 2a0a539db..3c045f29c 100644 --- a/Telegram/SourceFiles/inline_bots/bot_attach_web_view.cpp +++ b/Telegram/SourceFiles/inline_bots/bot_attach_web_view.cpp @@ -1537,8 +1537,10 @@ void AttachWebView::confirmAddToMenu( } _confirmAddBox = active->show(Box([=](not_null box) { const auto allowed = std::make_shared(); + const auto disclaimer = !disclaimerAccepted(bot); const auto done = [=](Fn close) { - const auto state = ((*allowed) && (*allowed)->checked()) + const auto state = (disclaimer + || (*allowed) && (*allowed)->checked()) ? ToggledState::AllowedToWrite : ToggledState::Added; toggleInMenu(bot.user, state, [=] { @@ -1551,13 +1553,22 @@ void AttachWebView::confirmAddToMenu( }); close(); }; - const auto disclaimer = !disclaimerAccepted(bot); if (disclaimer) { FillDisclaimerBox(box, [=] { _disclaimerAccepted.emplace(bot.user); _attachBotsUpdates.fire({}); done([] {}); }); + box->addRow(object_ptr( + box, + st::boxRowPadding.left())); + box->addRow(object_ptr( + box, + tr::lng_bot_will_be_added( + lt_bot, + rpl::single(Ui::Text::Bold(bot.name)), + Ui::Text::WithEntities), + st::boxLabel)); } else { Ui::ConfirmBox(box, { (bot.inMainMenu @@ -1569,40 +1580,26 @@ void AttachWebView::confirmAddToMenu( Ui::Text::WithEntities), done, }); - } - if (bot.requestWriteAccess) { - (*allowed) = box->addRow( - object_ptr( - box, - tr::lng_url_auth_allow_messages( - tr::now, - lt_bot, - Ui::Text::Bold(bot.name), - Ui::Text::WithEntities), - true, - st::urlAuthCheckbox), - style::margins( - st::boxRowPadding.left(), - (disclaimer - ? st::boxPhotoCaptionSkip - : st::boxRowPadding.left()), - st::boxRowPadding.right(), - st::boxRowPadding.left())); - (*allowed)->setAllowTextLines(); - } - if (disclaimer) { - if (!bot.requestWriteAccess) { - box->addRow(object_ptr( - box, - st::boxRowPadding.left())); + if (bot.requestWriteAccess) { + (*allowed) = box->addRow( + object_ptr( + box, + tr::lng_url_auth_allow_messages( + tr::now, + lt_bot, + Ui::Text::Bold(bot.name), + Ui::Text::WithEntities), + true, + st::urlAuthCheckbox), + style::margins( + st::boxRowPadding.left(), + (disclaimer + ? st::boxPhotoCaptionSkip + : st::boxRowPadding.left()), + st::boxRowPadding.right(), + st::boxRowPadding.left())); + (*allowed)->setAllowTextLines(); } - box->addRow(object_ptr( - box, - tr::lng_bot_will_be_added( - lt_bot, - rpl::single(Ui::Text::Bold(bot.name)), - Ui::Text::WithEntities), - st::boxLabel)); } })); }