mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-30 22:16:14 +00:00
Support creating polls from bot keyboards.
This commit is contained in:
@@ -12,6 +12,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "core/application.h"
|
||||
#include "media/clip/media_clip_reader.h"
|
||||
#include "window/window_session_controller.h"
|
||||
#include "window/window_peer_menu.h"
|
||||
#include "history/history_item_components.h"
|
||||
#include "base/platform/base_platform_info.h"
|
||||
#include "data/data_peer.h"
|
||||
@@ -115,6 +116,19 @@ void activateBotCommand(
|
||||
}));
|
||||
} break;
|
||||
|
||||
case ButtonType::RequestPoll: {
|
||||
hideSingleUseKeyboard(msg);
|
||||
auto chosen = PollData::Flags();
|
||||
auto disabled = PollData::Flags();
|
||||
if (!button->data.isEmpty()) {
|
||||
disabled |= PollData::Flag::Quiz;
|
||||
if (button->data[0]) {
|
||||
chosen |= PollData::Flag::Quiz;
|
||||
}
|
||||
}
|
||||
Window::PeerMenuCreatePoll(msg->history()->peer, chosen, disabled);
|
||||
} break;
|
||||
|
||||
case ButtonType::SwitchInlineSame:
|
||||
case ButtonType::SwitchInline: {
|
||||
if (auto m = App::main()) {
|
||||
|
Reference in New Issue
Block a user