From 579eef5f10f3a4cdad12df160c30f1d558fc73ab Mon Sep 17 00:00:00 2001 From: levlam Date: Thu, 22 Jun 2023 13:47:52 +0300 Subject: [PATCH] Rename ChatReportReason to ReportReason. --- td/generate/scheme/td_api.tl | 32 ++++++++++++++++---------------- td/telegram/ReportReason.cpp | 22 +++++++++++----------- td/telegram/ReportReason.h | 2 +- td/telegram/cli.cpp | 30 +++++++++++++++--------------- 4 files changed, 43 insertions(+), 43 deletions(-) diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 448c5510b..dd68aa431 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -1507,11 +1507,11 @@ publicChatTypeIsLocationBased = PublicChatType; //@class ChatActionBar @description Describes actions which must be possible to do through a chat action bar -//@description The chat can be reported as spam using the method reportChat with the reason chatReportReasonSpam. If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be shown +//@description The chat can be reported as spam using the method reportChat with the reason reportReasonSpam. If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be shown //@can_unarchive If true, the chat was automatically archived and can be moved back to the main chat list using addChatToList simultaneously with setting chat notification settings to default using setChatNotificationSettings chatActionBarReportSpam can_unarchive:Bool = ChatActionBar; -//@description The chat is a location-based supergroup, which can be reported as having unrelated location using the method reportChat with the reason chatReportReasonUnrelatedLocation +//@description The chat is a location-based supergroup, which can be reported as having unrelated location using the method reportChat with the reason reportReasonUnrelatedLocation chatActionBarReportUnrelatedLocation = ChatActionBar; //@description The chat is a recently created group chat to which new members can be invited @@ -4639,37 +4639,37 @@ connectedWebsite id:int64 domain_name:string bot_user_id:int53 browser:string pl connectedWebsites websites:vector = ConnectedWebsites; -//@class ChatReportReason @description Describes the reason why a chat is reported +//@class ReportReason @description Describes the reason why a chat is reported //@description The chat contains spam messages -chatReportReasonSpam = ChatReportReason; +reportReasonSpam = ReportReason; //@description The chat promotes violence -chatReportReasonViolence = ChatReportReason; +reportReasonViolence = ReportReason; //@description The chat contains pornographic messages -chatReportReasonPornography = ChatReportReason; +reportReasonPornography = ReportReason; //@description The chat has child abuse related content -chatReportReasonChildAbuse = ChatReportReason; +reportReasonChildAbuse = ReportReason; //@description The chat contains copyrighted content -chatReportReasonCopyright = ChatReportReason; +reportReasonCopyright = ReportReason; //@description The location-based chat is unrelated to its stated location -chatReportReasonUnrelatedLocation = ChatReportReason; +reportReasonUnrelatedLocation = ReportReason; //@description The chat represents a fake account -chatReportReasonFake = ChatReportReason; +reportReasonFake = ReportReason; //@description The chat has illegal drugs related content -chatReportReasonIllegalDrugs = ChatReportReason; +reportReasonIllegalDrugs = ReportReason; //@description The chat contains messages with personal details -chatReportReasonPersonalDetails = ChatReportReason; +reportReasonPersonalDetails = ReportReason; //@description A custom reason provided by the user -chatReportReasonCustom = ChatReportReason; +reportReasonCustom = ReportReason; //@class TargetChat @description Describes the target chat to be opened @@ -7297,7 +7297,7 @@ getStoryViewers story_id:int32 offset_viewer:messageViewer limit:int32 = Message //@story_id The identifier of the story to report //@reason The reason for reporting the story //@text Additional report details; 0-1024 characters -reportStory story_sender_user_id:int53 story_id:int32 reason:ChatReportReason text:string = Ok; +reportStory story_sender_user_id:int53 story_id:int32 reason:ReportReason text:string = Ok; //@description Returns information about a bot that can be added to attachment menu @bot_user_id Bot's user identifier @@ -8272,14 +8272,14 @@ removeChatActionBar chat_id:int53 = Ok; //@message_ids Identifiers of reported messages; may be empty to report the whole chat //@reason The reason for reporting the chat //@text Additional report details; 0-1024 characters -reportChat chat_id:int53 message_ids:vector reason:ChatReportReason text:string = Ok; +reportChat chat_id:int53 message_ids:vector reason:ReportReason text:string = Ok; //@description Reports a chat photo to the Telegram moderators. A chat photo can be reported only if chat.can_be_reported //@chat_id Chat identifier //@file_id Identifier of the photo to report. Only full photos from chatPhoto can be reported //@reason The reason for reporting the chat photo //@text Additional report details; 0-1024 characters -reportChatPhoto chat_id:int53 file_id:int32 reason:ChatReportReason text:string = Ok; +reportChatPhoto chat_id:int53 file_id:int32 reason:ReportReason text:string = Ok; //@description Reports reactions set on a message to the Telegram moderators. Reactions on a message can be reported only if message.can_report_reactions //@chat_id Chat identifier diff --git a/td/telegram/ReportReason.cpp b/td/telegram/ReportReason.cpp index 36e629b60..9ba8d3413 100644 --- a/td/telegram/ReportReason.cpp +++ b/td/telegram/ReportReason.cpp @@ -10,7 +10,7 @@ namespace td { -Result ReportReason::get_report_reason(td_api::object_ptr reason, +Result ReportReason::get_report_reason(td_api::object_ptr reason, string &&message) { if (reason == nullptr) { return Status::Error(400, "Chat report reason must be non-empty"); @@ -21,25 +21,25 @@ Result ReportReason::get_report_reason(td_api::object_ptrget_id()) { - case td_api::chatReportReasonSpam::ID: + case td_api::reportReasonSpam::ID: return ReportReason::Type::Spam; - case td_api::chatReportReasonViolence::ID: + case td_api::reportReasonViolence::ID: return ReportReason::Type::Violence; - case td_api::chatReportReasonPornography::ID: + case td_api::reportReasonPornography::ID: return ReportReason::Type::Pornography; - case td_api::chatReportReasonChildAbuse::ID: + case td_api::reportReasonChildAbuse::ID: return ReportReason::Type::ChildAbuse; - case td_api::chatReportReasonCopyright::ID: + case td_api::reportReasonCopyright::ID: return ReportReason::Type::Copyright; - case td_api::chatReportReasonUnrelatedLocation::ID: + case td_api::reportReasonUnrelatedLocation::ID: return ReportReason::Type::UnrelatedLocation; - case td_api::chatReportReasonFake::ID: + case td_api::reportReasonFake::ID: return ReportReason::Type::Fake; - case td_api::chatReportReasonIllegalDrugs::ID: + case td_api::reportReasonIllegalDrugs::ID: return ReportReason::Type::IllegalDrugs; - case td_api::chatReportReasonPersonalDetails::ID: + case td_api::reportReasonPersonalDetails::ID: return ReportReason::Type::PersonalDetails; - case td_api::chatReportReasonCustom::ID: + case td_api::reportReasonCustom::ID: return ReportReason::Type::Custom; default: UNREACHABLE(); diff --git a/td/telegram/ReportReason.h b/td/telegram/ReportReason.h index 3ea27d70b..6368cdedf 100644 --- a/td/telegram/ReportReason.h +++ b/td/telegram/ReportReason.h @@ -39,7 +39,7 @@ class ReportReason { public: ReportReason() = default; - static Result get_report_reason(td_api::object_ptr reason, string &&message); + static Result get_report_reason(td_api::object_ptr reason, string &&message); tl_object_ptr get_input_report_reason() const; diff --git a/td/telegram/cli.cpp b/td/telegram/cli.cpp index 4ecf29b40..292be73d4 100644 --- a/td/telegram/cli.cpp +++ b/td/telegram/cli.cpp @@ -1784,39 +1784,39 @@ class CliClient final : public Actor { return td_api::make_object(); } - static td_api::object_ptr as_chat_report_reason(MutableSlice reason) { + static td_api::object_ptr as_report_reason(MutableSlice reason) { reason = trim(reason); if (reason == "null") { return nullptr; } if (reason == "spam") { - return td_api::make_object(); + return td_api::make_object(); } if (reason == "violence") { - return td_api::make_object(); + return td_api::make_object(); } if (reason == "porno") { - return td_api::make_object(); + return td_api::make_object(); } if (reason == "ca") { - return td_api::make_object(); + return td_api::make_object(); } if (reason == "copyright") { - return td_api::make_object(); + return td_api::make_object(); } if (reason == "geo" || reason == "location") { - return td_api::make_object(); + return td_api::make_object(); } if (reason == "fake") { - return td_api::make_object(); + return td_api::make_object(); } if (reason == "drugs") { - return td_api::make_object(); + return td_api::make_object(); } if (reason == "pd") { - return td_api::make_object(); + return td_api::make_object(); } - return td_api::make_object(); + return td_api::make_object(); } static td_api::object_ptr as_network_type(MutableSlice type) { @@ -4082,8 +4082,8 @@ class CliClient final : public Actor { string reason; string text; get_args(args, story_sender_user_id, story_id, reason, text); - send_request(td_api::make_object(story_sender_user_id, story_id, - as_chat_report_reason(reason), text)); + send_request( + td_api::make_object(story_sender_user_id, story_id, as_report_reason(reason), text)); } else if (op == "gamb") { UserId user_id; get_args(args, user_id); @@ -5566,14 +5566,14 @@ class CliClient final : public Actor { string text; get_args(args, chat_id, message_ids, reason, text); send_request(td_api::make_object(chat_id, as_message_ids(message_ids), - as_chat_report_reason(reason), text)); + as_report_reason(reason), text)); } else if (op == "rcp") { ChatId chat_id; FileId file_id; string reason; string text; get_args(args, chat_id, file_id, reason, text); - send_request(td_api::make_object(chat_id, file_id, as_chat_report_reason(reason), text)); + send_request(td_api::make_object(chat_id, file_id, as_report_reason(reason), text)); } else if (op == "reportmr") { ChatId chat_id; MessageId message_id;