From 5a0a3f2c140bbb43d6977bfef2c9621a3c51d769 Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 4 Mar 2024 22:33:25 +0300 Subject: [PATCH] Add chat type check in get_quick_reply_message_contents. --- td/telegram/QuickReplyManager.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/td/telegram/QuickReplyManager.cpp b/td/telegram/QuickReplyManager.cpp index 7f6f6a7a1..c099f7d9c 100644 --- a/td/telegram/QuickReplyManager.cpp +++ b/td/telegram/QuickReplyManager.cpp @@ -1329,6 +1329,9 @@ Result> QuickReplyManager::g if (!td_->dialog_manager_->have_input_peer(dialog_id, AccessRights::Write)) { return Status::Error(400, "Have no write access to the chat"); } + if (dialog_id.get_type() != DialogType::User || td_->contacts_manager_->is_user_bot(dialog_id.get_user_id())) { + return Status::Error(400, "Can't use quick replies in the chat"); + } std::unordered_map, Hash> new_media_album_ids; vector result;