diff --git a/Telegram/SourceFiles/inline_bots/bot_attach_web_view.cpp b/Telegram/SourceFiles/inline_bots/bot_attach_web_view.cpp index 1a2703675c..da0b08d7e2 100644 --- a/Telegram/SourceFiles/inline_bots/bot_attach_web_view.cpp +++ b/Telegram/SourceFiles/inline_bots/bot_attach_web_view.cpp @@ -32,6 +32,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "ui/painter.h" #include "window/themes/window_theme.h" #include "window/window_controller.h" +#include "window/window_peer_menu.h" #include "window/window_session_controller.h" #include "webview/webview_interface.h" #include "core/application.h" @@ -1660,6 +1661,28 @@ std::unique_ptr MakeAttachBotsMenu( attach(false); }, &st::menuIconFile); } + if (peer->canCreatePolls()) { + ++minimal; + raw->addAction(tr::lng_polls_create(tr::now), [=] { + const auto action = actionFactory(); + const auto source = action.options.scheduled + ? Api::SendType::Scheduled + : Api::SendType::Normal; + const auto sendMenuType = action.replyTo.topicRootId + ? SendMenu::Type::SilentOnly + : SendMenu::Type::Scheduled; + const auto flag = PollData::Flags(); + const auto replyTo = action.replyTo; + Window::PeerMenuCreatePoll( + controller, + peer, + replyTo, + flag, + flag, + source, + sendMenuType); + }, &st::menuIconCreatePoll); + } for (const auto &bot : bots->attachBots()) { if (!bot.inAttachMenu || !PeerMatchesTypes(peer, bot.user, bot.types)) {