From 33877f740d70479fd3879944c1cf41430d26cdc1 Mon Sep 17 00:00:00 2001 From: Giuseppe Marino Date: Tue, 16 Mar 2021 20:26:37 +0100 Subject: [PATCH] Upstream merge: quick fix report chat now accepts a custom text for any reason Will have to think about adding an additional parameter --- telegram-bot-api/Client.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/telegram-bot-api/Client.cpp b/telegram-bot-api/Client.cpp index 44a6484..68d5298 100644 --- a/telegram-bot-api/Client.cpp +++ b/telegram-bot-api/Client.cpp @@ -6649,7 +6649,7 @@ td::Result> Client::get_report_reas } else if (reason == "violence") { result = make_object(); } else { - result = make_object(reason.str()); + result = make_object(); } 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(chat_id, std::move(reason), std::move(message_ids)), + + send_request(make_object(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(std::move(query))); }); return Status::OK();