aboutsummaryrefslogtreecommitdiffhomepage
path: root/td/telegram/QuickReplyManager.cpp
diff options
context:
space:
mode:
authorlevlam <levlam@telegram.org>2026-04-27 20:35:08 +0300
committerlevlam <levlam@telegram.org>2026-04-27 20:35:08 +0300
commitc81e6da9faa17c75038b244c2dcc762e4da72462 (patch)
treec575871b873376dd6f6b6fffd6655c296a2cc399 /td/telegram/QuickReplyManager.cpp
parentc6eb7d1da6a2b4c9ab78682e35439fc4a6413e92 (diff)
Disallow polls with media in quick replies.
Diffstat (limited to 'td/telegram/QuickReplyManager.cpp')
-rw-r--r--td/telegram/QuickReplyManager.cpp12
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 {