diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 43643b82..84b12eb2 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -4010,5 +4010,5 @@ testProxy server:string port:int32 type:ProxyType = Ok; testGetDifference = Ok; //@description Does nothing and ensures that the Update object is used; for testing only. This is an offline method. Can be called before authorization testUseUpdate = Update; -//@description Does nothing and ensures that the Error object is used; for testing only. This is an offline method. Can be called before authorization -testUseError = Error; +//@description Returns the specified error and ensures that the Error object is used; for testing only. This is an offline method. Can be called before authorization @error The error to be returned +testReturnError error:error = Error; diff --git a/td/generate/scheme/td_api.tlo b/td/generate/scheme/td_api.tlo index e21f0048..03c41f77 100644 Binary files a/td/generate/scheme/td_api.tlo and b/td/generate/scheme/td_api.tlo differ diff --git a/td/telegram/Td.cpp b/td/telegram/Td.cpp index 2eca20ed..46294ab9 100644 --- a/td/telegram/Td.cpp +++ b/td/telegram/Td.cpp @@ -3433,7 +3433,7 @@ bool Td::is_preinitialization_request(int32 id) { case td_api::getCurrentState::ID: case td_api::setAlarm::ID: case td_api::testUseUpdate::ID: - case td_api::testUseError::ID: + case td_api::testReturnError::ID: case td_api::testCallEmpty::ID: case td_api::testSquareInt::ID: case td_api::testCallString::ID: @@ -7686,8 +7686,8 @@ void Td::on_request(uint64 id, td_api::testUseUpdate &request) { send_closure(actor_id(this), &Td::send_result, id, nullptr); } -void Td::on_request(uint64 id, td_api::testUseError &request) { - send_closure(actor_id(this), &Td::send_result, id, nullptr); +void Td::on_request(uint64 id, td_api::testReturnError &request) { + send_closure(actor_id(this), &Td::send_result, id, std::move(request.error_)); } void Td::on_request(uint64 id, td_api::testCallEmpty &request) { diff --git a/td/telegram/Td.h b/td/telegram/Td.h index 94c410fb..f292eabf 100644 --- a/td/telegram/Td.h +++ b/td/telegram/Td.h @@ -1027,7 +1027,7 @@ class Td final : public NetQueryCallback { void on_request(uint64 id, td_api::testProxy &request); void on_request(uint64 id, td_api::testGetDifference &request); void on_request(uint64 id, td_api::testUseUpdate &request); - void on_request(uint64 id, td_api::testUseError &request); + void on_request(uint64 id, td_api::testReturnError &request); void on_request(uint64 id, td_api::testCallEmpty &request); void on_request(uint64 id, td_api::testSquareInt &request); void on_request(uint64 id, td_api::testCallString &request); diff --git a/td/telegram/cli.cpp b/td/telegram/cli.cpp index cf18f541..53f2bfd7 100644 --- a/td/telegram/cli.cpp +++ b/td/telegram/cli.cpp @@ -3483,6 +3483,9 @@ class CliClient final : public Actor { } else if (op == "racm") { string chat_id = args; send_request(td_api::make_object(as_chat_id(chat_id))); + } else if (op == "tre") { + send_request(td_api::make_object( + args.empty() ? nullptr : td_api::make_object(-1, args))); } else if (op == "dpp") { send_request(td_api::make_object(to_integer(args))); } else if (op == "gcnse" || op == "gcnses") {