diff options
| author | levlam <levlam@telegram.org> | 2026-04-27 20:35:08 +0300 |
|---|---|---|
| committer | levlam <levlam@telegram.org> | 2026-04-27 20:35:08 +0300 |
| commit | c81e6da9faa17c75038b244c2dcc762e4da72462 (patch) | |
| tree | c575871b873376dd6f6b6fffd6655c296a2cc399 /td/telegram/QuickReplyManager.cpp | |
| parent | c6eb7d1da6a2b4c9ab78682e35439fc4a6413e92 (diff) | |
Disallow polls with media in quick replies.
Diffstat (limited to 'td/telegram/QuickReplyManager.cpp')
| -rw-r--r-- | td/telegram/QuickReplyManager.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/td/telegram/QuickReplyManager.cpp b/td/telegram/QuickReplyManager.cpp index 5cc498886..c12d51883 100644 --- a/td/telegram/QuickReplyManager.cpp +++ b/td/telegram/QuickReplyManager.cpp @@ -3460,7 +3460,17 @@ Result<InputMessageContent> QuickReplyManager::process_input_message_content( return Status::Error(400, "Can't add live location as a quick reply"); } // update addQuickReplyShortcutMessage documentation - return get_input_message_content(DialogId(), std::move(input_message_content), td_, true); + TRY_RESULT(content, get_input_message_content(DialogId(), std::move(input_message_content), td_, true)); + if (content.content->get_type() == MessageContentType::Poll) { + auto file_ids = get_message_content_file_ids(content.content.get(), td_); + for (auto file_id : file_ids) { + if (file_id.is_valid()) { + // TODO remove when supported + return Status::Error(400, "Can't send polls with media as a quick reply"); + } + } + } + return std::move(content); } MessageId QuickReplyManager::get_next_message_id(Shortcut *s, MessageType type) const { |
