Rename ChatReportReason to ReportReason.
This commit is contained in:
parent
26c8c0f4fa
commit
579eef5f10
|
@ -1507,11 +1507,11 @@ publicChatTypeIsLocationBased = PublicChatType;
|
||||||
|
|
||||||
//@class ChatActionBar @description Describes actions which must be possible to do through a chat action bar
|
//@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
|
//@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;
|
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;
|
chatActionBarReportUnrelatedLocation = ChatActionBar;
|
||||||
|
|
||||||
//@description The chat is a recently created group chat to which new members can be invited
|
//@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<connectedWebsite> = ConnectedWebsites;
|
connectedWebsites websites:vector<connectedWebsite> = 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
|
//@description The chat contains spam messages
|
||||||
chatReportReasonSpam = ChatReportReason;
|
reportReasonSpam = ReportReason;
|
||||||
|
|
||||||
//@description The chat promotes violence
|
//@description The chat promotes violence
|
||||||
chatReportReasonViolence = ChatReportReason;
|
reportReasonViolence = ReportReason;
|
||||||
|
|
||||||
//@description The chat contains pornographic messages
|
//@description The chat contains pornographic messages
|
||||||
chatReportReasonPornography = ChatReportReason;
|
reportReasonPornography = ReportReason;
|
||||||
|
|
||||||
//@description The chat has child abuse related content
|
//@description The chat has child abuse related content
|
||||||
chatReportReasonChildAbuse = ChatReportReason;
|
reportReasonChildAbuse = ReportReason;
|
||||||
|
|
||||||
//@description The chat contains copyrighted content
|
//@description The chat contains copyrighted content
|
||||||
chatReportReasonCopyright = ChatReportReason;
|
reportReasonCopyright = ReportReason;
|
||||||
|
|
||||||
//@description The location-based chat is unrelated to its stated location
|
//@description The location-based chat is unrelated to its stated location
|
||||||
chatReportReasonUnrelatedLocation = ChatReportReason;
|
reportReasonUnrelatedLocation = ReportReason;
|
||||||
|
|
||||||
//@description The chat represents a fake account
|
//@description The chat represents a fake account
|
||||||
chatReportReasonFake = ChatReportReason;
|
reportReasonFake = ReportReason;
|
||||||
|
|
||||||
//@description The chat has illegal drugs related content
|
//@description The chat has illegal drugs related content
|
||||||
chatReportReasonIllegalDrugs = ChatReportReason;
|
reportReasonIllegalDrugs = ReportReason;
|
||||||
|
|
||||||
//@description The chat contains messages with personal details
|
//@description The chat contains messages with personal details
|
||||||
chatReportReasonPersonalDetails = ChatReportReason;
|
reportReasonPersonalDetails = ReportReason;
|
||||||
|
|
||||||
//@description A custom reason provided by the user
|
//@description A custom reason provided by the user
|
||||||
chatReportReasonCustom = ChatReportReason;
|
reportReasonCustom = ReportReason;
|
||||||
|
|
||||||
|
|
||||||
//@class TargetChat @description Describes the target chat to be opened
|
//@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
|
//@story_id The identifier of the story to report
|
||||||
//@reason The reason for reporting the story
|
//@reason The reason for reporting the story
|
||||||
//@text Additional report details; 0-1024 characters
|
//@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
|
//@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
|
//@message_ids Identifiers of reported messages; may be empty to report the whole chat
|
||||||
//@reason The reason for reporting the chat
|
//@reason The reason for reporting the chat
|
||||||
//@text Additional report details; 0-1024 characters
|
//@text Additional report details; 0-1024 characters
|
||||||
reportChat chat_id:int53 message_ids:vector<int53> reason:ChatReportReason text:string = Ok;
|
reportChat chat_id:int53 message_ids:vector<int53> 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
|
//@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
|
//@chat_id Chat identifier
|
||||||
//@file_id Identifier of the photo to report. Only full photos from chatPhoto can be reported
|
//@file_id Identifier of the photo to report. Only full photos from chatPhoto can be reported
|
||||||
//@reason The reason for reporting the chat photo
|
//@reason The reason for reporting the chat photo
|
||||||
//@text Additional report details; 0-1024 characters
|
//@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
|
//@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
|
//@chat_id Chat identifier
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
namespace td {
|
namespace td {
|
||||||
|
|
||||||
Result<ReportReason> ReportReason::get_report_reason(td_api::object_ptr<td_api::ChatReportReason> reason,
|
Result<ReportReason> ReportReason::get_report_reason(td_api::object_ptr<td_api::ReportReason> reason,
|
||||||
string &&message) {
|
string &&message) {
|
||||||
if (reason == nullptr) {
|
if (reason == nullptr) {
|
||||||
return Status::Error(400, "Chat report reason must be non-empty");
|
return Status::Error(400, "Chat report reason must be non-empty");
|
||||||
|
@ -21,25 +21,25 @@ Result<ReportReason> ReportReason::get_report_reason(td_api::object_ptr<td_api::
|
||||||
|
|
||||||
auto type = [&] {
|
auto type = [&] {
|
||||||
switch (reason->get_id()) {
|
switch (reason->get_id()) {
|
||||||
case td_api::chatReportReasonSpam::ID:
|
case td_api::reportReasonSpam::ID:
|
||||||
return ReportReason::Type::Spam;
|
return ReportReason::Type::Spam;
|
||||||
case td_api::chatReportReasonViolence::ID:
|
case td_api::reportReasonViolence::ID:
|
||||||
return ReportReason::Type::Violence;
|
return ReportReason::Type::Violence;
|
||||||
case td_api::chatReportReasonPornography::ID:
|
case td_api::reportReasonPornography::ID:
|
||||||
return ReportReason::Type::Pornography;
|
return ReportReason::Type::Pornography;
|
||||||
case td_api::chatReportReasonChildAbuse::ID:
|
case td_api::reportReasonChildAbuse::ID:
|
||||||
return ReportReason::Type::ChildAbuse;
|
return ReportReason::Type::ChildAbuse;
|
||||||
case td_api::chatReportReasonCopyright::ID:
|
case td_api::reportReasonCopyright::ID:
|
||||||
return ReportReason::Type::Copyright;
|
return ReportReason::Type::Copyright;
|
||||||
case td_api::chatReportReasonUnrelatedLocation::ID:
|
case td_api::reportReasonUnrelatedLocation::ID:
|
||||||
return ReportReason::Type::UnrelatedLocation;
|
return ReportReason::Type::UnrelatedLocation;
|
||||||
case td_api::chatReportReasonFake::ID:
|
case td_api::reportReasonFake::ID:
|
||||||
return ReportReason::Type::Fake;
|
return ReportReason::Type::Fake;
|
||||||
case td_api::chatReportReasonIllegalDrugs::ID:
|
case td_api::reportReasonIllegalDrugs::ID:
|
||||||
return ReportReason::Type::IllegalDrugs;
|
return ReportReason::Type::IllegalDrugs;
|
||||||
case td_api::chatReportReasonPersonalDetails::ID:
|
case td_api::reportReasonPersonalDetails::ID:
|
||||||
return ReportReason::Type::PersonalDetails;
|
return ReportReason::Type::PersonalDetails;
|
||||||
case td_api::chatReportReasonCustom::ID:
|
case td_api::reportReasonCustom::ID:
|
||||||
return ReportReason::Type::Custom;
|
return ReportReason::Type::Custom;
|
||||||
default:
|
default:
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
|
|
|
@ -39,7 +39,7 @@ class ReportReason {
|
||||||
public:
|
public:
|
||||||
ReportReason() = default;
|
ReportReason() = default;
|
||||||
|
|
||||||
static Result<ReportReason> get_report_reason(td_api::object_ptr<td_api::ChatReportReason> reason, string &&message);
|
static Result<ReportReason> get_report_reason(td_api::object_ptr<td_api::ReportReason> reason, string &&message);
|
||||||
|
|
||||||
tl_object_ptr<telegram_api::ReportReason> get_input_report_reason() const;
|
tl_object_ptr<telegram_api::ReportReason> get_input_report_reason() const;
|
||||||
|
|
||||||
|
|
|
@ -1784,39 +1784,39 @@ class CliClient final : public Actor {
|
||||||
return td_api::make_object<td_api::chatActionTyping>();
|
return td_api::make_object<td_api::chatActionTyping>();
|
||||||
}
|
}
|
||||||
|
|
||||||
static td_api::object_ptr<td_api::ChatReportReason> as_chat_report_reason(MutableSlice reason) {
|
static td_api::object_ptr<td_api::ReportReason> as_report_reason(MutableSlice reason) {
|
||||||
reason = trim(reason);
|
reason = trim(reason);
|
||||||
if (reason == "null") {
|
if (reason == "null") {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
if (reason == "spam") {
|
if (reason == "spam") {
|
||||||
return td_api::make_object<td_api::chatReportReasonSpam>();
|
return td_api::make_object<td_api::reportReasonSpam>();
|
||||||
}
|
}
|
||||||
if (reason == "violence") {
|
if (reason == "violence") {
|
||||||
return td_api::make_object<td_api::chatReportReasonViolence>();
|
return td_api::make_object<td_api::reportReasonViolence>();
|
||||||
}
|
}
|
||||||
if (reason == "porno") {
|
if (reason == "porno") {
|
||||||
return td_api::make_object<td_api::chatReportReasonPornography>();
|
return td_api::make_object<td_api::reportReasonPornography>();
|
||||||
}
|
}
|
||||||
if (reason == "ca") {
|
if (reason == "ca") {
|
||||||
return td_api::make_object<td_api::chatReportReasonChildAbuse>();
|
return td_api::make_object<td_api::reportReasonChildAbuse>();
|
||||||
}
|
}
|
||||||
if (reason == "copyright") {
|
if (reason == "copyright") {
|
||||||
return td_api::make_object<td_api::chatReportReasonCopyright>();
|
return td_api::make_object<td_api::reportReasonCopyright>();
|
||||||
}
|
}
|
||||||
if (reason == "geo" || reason == "location") {
|
if (reason == "geo" || reason == "location") {
|
||||||
return td_api::make_object<td_api::chatReportReasonUnrelatedLocation>();
|
return td_api::make_object<td_api::reportReasonUnrelatedLocation>();
|
||||||
}
|
}
|
||||||
if (reason == "fake") {
|
if (reason == "fake") {
|
||||||
return td_api::make_object<td_api::chatReportReasonFake>();
|
return td_api::make_object<td_api::reportReasonFake>();
|
||||||
}
|
}
|
||||||
if (reason == "drugs") {
|
if (reason == "drugs") {
|
||||||
return td_api::make_object<td_api::chatReportReasonIllegalDrugs>();
|
return td_api::make_object<td_api::reportReasonIllegalDrugs>();
|
||||||
}
|
}
|
||||||
if (reason == "pd") {
|
if (reason == "pd") {
|
||||||
return td_api::make_object<td_api::chatReportReasonPersonalDetails>();
|
return td_api::make_object<td_api::reportReasonPersonalDetails>();
|
||||||
}
|
}
|
||||||
return td_api::make_object<td_api::chatReportReasonCustom>();
|
return td_api::make_object<td_api::reportReasonCustom>();
|
||||||
}
|
}
|
||||||
|
|
||||||
static td_api::object_ptr<td_api::NetworkType> as_network_type(MutableSlice type) {
|
static td_api::object_ptr<td_api::NetworkType> as_network_type(MutableSlice type) {
|
||||||
|
@ -4082,8 +4082,8 @@ class CliClient final : public Actor {
|
||||||
string reason;
|
string reason;
|
||||||
string text;
|
string text;
|
||||||
get_args(args, story_sender_user_id, story_id, reason, text);
|
get_args(args, story_sender_user_id, story_id, reason, text);
|
||||||
send_request(td_api::make_object<td_api::reportStory>(story_sender_user_id, story_id,
|
send_request(
|
||||||
as_chat_report_reason(reason), text));
|
td_api::make_object<td_api::reportStory>(story_sender_user_id, story_id, as_report_reason(reason), text));
|
||||||
} else if (op == "gamb") {
|
} else if (op == "gamb") {
|
||||||
UserId user_id;
|
UserId user_id;
|
||||||
get_args(args, user_id);
|
get_args(args, user_id);
|
||||||
|
@ -5566,14 +5566,14 @@ class CliClient final : public Actor {
|
||||||
string text;
|
string text;
|
||||||
get_args(args, chat_id, message_ids, reason, text);
|
get_args(args, chat_id, message_ids, reason, text);
|
||||||
send_request(td_api::make_object<td_api::reportChat>(chat_id, as_message_ids(message_ids),
|
send_request(td_api::make_object<td_api::reportChat>(chat_id, as_message_ids(message_ids),
|
||||||
as_chat_report_reason(reason), text));
|
as_report_reason(reason), text));
|
||||||
} else if (op == "rcp") {
|
} else if (op == "rcp") {
|
||||||
ChatId chat_id;
|
ChatId chat_id;
|
||||||
FileId file_id;
|
FileId file_id;
|
||||||
string reason;
|
string reason;
|
||||||
string text;
|
string text;
|
||||||
get_args(args, chat_id, file_id, reason, text);
|
get_args(args, chat_id, file_id, reason, text);
|
||||||
send_request(td_api::make_object<td_api::reportChatPhoto>(chat_id, file_id, as_chat_report_reason(reason), text));
|
send_request(td_api::make_object<td_api::reportChatPhoto>(chat_id, file_id, as_report_reason(reason), text));
|
||||||
} else if (op == "reportmr") {
|
} else if (op == "reportmr") {
|
||||||
ChatId chat_id;
|
ChatId chat_id;
|
||||||
MessageId message_id;
|
MessageId message_id;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user