diff --git a/td/telegram/InlineQueriesManager.cpp b/td/telegram/InlineQueriesManager.cpp index 6c1ba0fd2..a35d146be 100644 --- a/td/telegram/InlineQueriesManager.cpp +++ b/td/telegram/InlineQueriesManager.cpp @@ -1754,6 +1754,7 @@ bool InlineQueriesManager::load_recently_used_bots(Promise &promise) { tl_object_ptr InlineQueriesManager::get_inline_query_results_object(uint64 query_hash) { // TODO filter out games if request is sent in a broadcast channel or in a secret chat + // TODO filter out invoice messages if request is sent in a secret chat return decrease_pending_request_count(query_hash); } diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index 86a073f67..88625dceb 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -23134,7 +23134,7 @@ Status MessagesManager::can_send_message_content(DialogId dialog_id, const Messa break; case MessageContentType::Audio: if (!permissions.can_send_media()) { - return Status::Error(400, "Not enough rights to send audios to the chat"); + return Status::Error(400, "Not enough rights to send music to the chat"); } break; case MessageContentType::Contact: @@ -23167,19 +23167,11 @@ Status MessagesManager::can_send_message_content(DialogId dialog_id, const Messa } break; case MessageContentType::Invoice: - if (!is_forward) { - switch (dialog_type) { - case DialogType::User: - // ok - break; - case DialogType::Chat: - case DialogType::Channel: - case DialogType::SecretChat: - return Status::Error(400, "Invoices can be sent only to private chats"); - case DialogType::None: - default: - UNREACHABLE(); - } + if (!permissions.can_send_messages()) { + return Status::Error(400, "Not enough rights to send invoice messages to the chat"); + } + if (dialog_type == DialogType::SecretChat) { + return Status::Error(400, "Invoice messages can't be sent to secret chats"); } break; case MessageContentType::LiveLocation: