Upstream merge: quick fix report chat now accepts a custom text for any reason

Will have to think about adding an additional parameter
This commit is contained in:
Giuseppe Marino 2021-03-16 20:26:37 +01:00
parent ff7d232f42
commit 33877f740d
No known key found for this signature in database
GPG Key ID: 2BC70C5463357449

View File

@ -6649,7 +6649,7 @@ td::Result<td_api::object_ptr<td_api::ChatReportReason>> Client::get_report_reas
} else if (reason == "violence") {
result = make_object<td_api::chatReportReasonViolence>();
} else {
result = make_object<td_api::chatReportReasonCustom>(reason.str());
result = make_object<td_api::chatReportReasonCustom>();
}
return std::move(result);
}
@ -8494,7 +8494,8 @@ td::Status Client::process_report_chat_query(PromisedQueryPtr &query) {
check_chat(chat_id, AccessRights::Read, std::move(query),
[this, reason = std::move(reason), message_ids = std::move(message_ids)](int64 chat_id,
PromisedQueryPtr query) mutable {
send_request(make_object<td_api::reportChat>(chat_id, std::move(reason), std::move(message_ids)),
send_request(make_object<td_api::reportChat>(chat_id, std::move(message_ids), std::move(reason), reason->get_id() == td_api::chatReportReasonCustom::ID ? query->arg("reason").str() : td::string()),
std::make_unique<TdOnOkQueryCallback>(std::move(query)));
});
return Status::OK();