From a434bad933e17176c2482b6ddc0ee3aab06c7865 Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 16 Mar 2022 15:56:01 +0300 Subject: [PATCH] Improve error messages for forwards of messages with protected content. --- td/telegram/MessagesManager.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index f5e9dd9e8..8cdf8def8 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -28375,7 +28375,7 @@ Result MessagesManager::get_forwarded_messag if (get_dialog_has_protected_content(from_dialog_id)) { for (const auto ©_option : copy_options) { if (!copy_option.send_copy || !td_->auth_manager_->is_bot()) { - return Status::Error(400, "Administrators of the chat restricted message forwarding"); + return Status::Error(400, "Message has protected content and can't be forwarded"); } } } @@ -31468,6 +31468,8 @@ void MessagesManager::on_send_message_fail(int64 random_id, Status error) { error_message = "Failed to get HTTP URL content"; } else if (error.message() == "WEBPAGE_MEDIA_EMPTY") { error_message = "Wrong type of the web page content"; + } else if (error.message() == "CHAT_FORWARDS_RESTRICTED") { + error_message = "Message has protected content and can't be forwarded"; } else if (error.message() == "MEDIA_EMPTY") { auto content_type = m->content->get_type(); if (content_type == MessageContentType::Game) {