diff --git a/td/telegram/ConfigManager.cpp b/td/telegram/ConfigManager.cpp index dc5b47e43..adf704c58 100644 --- a/td/telegram/ConfigManager.cpp +++ b/td/telegram/ConfigManager.cpp @@ -1287,8 +1287,6 @@ void ConfigManager::process_app_config(tl_object_ptr &c LOG(INFO) << "Receive app config " << to_string(config); vector> new_values; - string wallet_blockchain_name; - string wallet_config; string ignored_restriction_reasons; vector dice_emojis; std::unordered_map dice_emoji_index; @@ -1299,23 +1297,7 @@ void ConfigManager::process_app_config(tl_object_ptr &c for (auto &key_value : static_cast(config.get())->value_) { Slice key = key_value->key_; telegram_api::JSONValue *value = key_value->value_.get(); - if (key == "test" || key == "wallet_enabled") { - continue; - } - if (key == "wallet_blockchain_name") { - if (value->get_id() == telegram_api::jsonString::ID) { - wallet_blockchain_name = std::move(static_cast(value)->value_); - } else { - LOG(ERROR) << "Receive unexpected wallet_blockchain_name " << to_string(*value); - } - continue; - } - if (key == "wallet_config") { - if (value->get_id() == telegram_api::jsonString::ID) { - wallet_config = std::move(static_cast(value)->value_); - } else { - LOG(ERROR) << "Receive unexpected wallet_config " << to_string(*value); - } + if (key == "test" || key == "wallet_enabled" || key == "wallet_blockchain_name" || key == "wallet_config") { continue; } if (key == "ignore_restriction_reasons") { @@ -1441,13 +1423,6 @@ void ConfigManager::process_app_config(tl_object_ptr &c config = make_tl_object(std::move(new_values)); ConfigShared &shared_config = G()->shared_config(); - if (wallet_config.empty()) { - shared_config.set_option_empty("default_ton_blockchain_config"); - shared_config.set_option_empty("default_ton_blockchain_name"); - } else { - shared_config.set_option_string("default_ton_blockchain_name", wallet_blockchain_name); - shared_config.set_option_string("default_ton_blockchain_config", wallet_config); - } if (ignored_restriction_reasons.empty()) { shared_config.set_option_empty("ignored_restriction_reasons"); @@ -1486,6 +1461,9 @@ void ConfigManager::process_app_config(tl_object_ptr &c } else { shared_config.set_option_string("animation_search_emojis", animation_search_emojis); } + + shared_config.set_option_empty("default_ton_blockchain_config"); + shared_config.set_option_empty("default_ton_blockchain_name"); } } // namespace td diff --git a/td/telegram/PasswordManager.cpp b/td/telegram/PasswordManager.cpp index 3e867c78c..6f4af18dd 100644 --- a/td/telegram/PasswordManager.cpp +++ b/td/telegram/PasswordManager.cpp @@ -732,41 +732,7 @@ void PasswordManager::drop_cached_secret() { LOG(INFO) << "Drop passport secret"; secret_ = optional(); } -/* -void PasswordManager::get_ton_wallet_password_salt(Promise> promise) { - if (!ton_wallet_password_salt_.empty()) { - return promise.set_value(td_api::make_object(ton_wallet_password_salt_)); - } - get_ton_wallet_password_salt_queries_.push_back(std::move(promise)); - if (get_ton_wallet_password_salt_queries_.size() == 1) { - send_with_promise(G()->net_query_creator().create(telegram_api::wallet_getKeySecretSalt(false)), - PromiseCreator::lambda([actor_id = actor_id(this)](Result r_query) mutable { - auto r_result = fetch_result(std::move(r_query)); - send_closure(actor_id, &PasswordManager::on_get_ton_wallet_password_salt, std::move(r_result)); - })); - } -} - -void PasswordManager::on_get_ton_wallet_password_salt( - Result> result) { - auto promises = std::move(get_ton_wallet_password_salt_queries_); - reset_to_empty(get_ton_wallet_password_salt_queries_); - CHECK(!promises.empty()); - - if (result.is_ok()) { - ton_wallet_password_salt_ = result.ok()->salt_.as_slice().str(); - - for (auto &promise : promises) { - promise.set_value(td_api::make_object(ton_wallet_password_salt_)); - } - } else { - for (auto &promise : promises) { - promise.set_error(result.error().clone()); - } - } -} -*/ void PasswordManager::timeout_expired() { if (Time::now() >= secret_expire_date_) { drop_cached_secret(); diff --git a/td/telegram/PasswordManager.h b/td/telegram/PasswordManager.h index 6f269b983..aad9a0b70 100644 --- a/td/telegram/PasswordManager.h +++ b/td/telegram/PasswordManager.h @@ -89,8 +89,6 @@ class PasswordManager : public NetQueryCallback { static TempPasswordState get_temp_password_state_sync(); - // void get_ton_wallet_password_salt(Promise> promise); - private: static constexpr size_t MIN_NEW_SALT_SIZE = 8; static constexpr size_t MIN_NEW_SECURE_SALT_SIZE = 8; @@ -162,9 +160,6 @@ class PasswordManager : public NetQueryCallback { int32 last_code_length_ = 0; - // string ton_wallet_password_salt_; - // vector>> get_ton_wallet_password_salt_queries_; - static Result decrypt_secure_secret( Slice password, tl_object_ptr algo_ptr, Slice secret, int64 secret_id); @@ -191,8 +186,6 @@ class PasswordManager : public NetQueryCallback { Promise promise); void on_finish_create_temp_password(Result result, bool dummy); - // void on_get_ton_wallet_password_salt(Result> result); - void on_result(NetQueryPtr query) override; void start_up() override; diff --git a/td/telegram/Payments.cpp b/td/telegram/Payments.cpp index 7e4e20c28..17ee57e0c 100644 --- a/td/telegram/Payments.cpp +++ b/td/telegram/Payments.cpp @@ -514,34 +514,7 @@ class GetBankCardInfoQuery : public Td::ResultHandler { promise_.set_error(std::move(status)); } }; -/* -class SendLiteRequestQuery : public Td::ResultHandler { - Promise> promise_; - public: - explicit SendLiteRequestQuery(Promise> &&promise) - : promise_(std::move(promise)) { - } - - void send(BufferSlice request) { - send_query(G()->net_query_creator().create_unauth(telegram_api::wallet_sendLiteRequest(std::move(request)))); - } - - void on_result(uint64 id, BufferSlice packet) override { - auto result_ptr = fetch_result(packet); - if (result_ptr.is_error()) { - return on_error(id, result_ptr.move_as_error()); - } - - auto response = result_ptr.move_as_ok(); - promise_.set_value(td_api::make_object(response->response_.as_slice().str())); - } - - void on_error(uint64 id, Status status) override { - promise_.set_error(std::move(status)); - } -}; -*/ bool operator==(const LabeledPricePart &lhs, const LabeledPricePart &rhs) { return lhs.label == rhs.label && lhs.amount == rhs.amount; } @@ -927,9 +900,5 @@ void delete_saved_credentials(Promise &&promise) { void get_bank_card_info(const string &bank_card_number, Promise> &&promise) { G()->td().get_actor_unsafe()->create_handler(std::move(promise))->send(bank_card_number); } -/* -void send_ton_lite_server_request(Slice request, Promise> &&promise) { - G()->td().get_actor_unsafe()->create_handler(std::move(promise))->send(BufferSlice{request}); -} -*/ + } // namespace td diff --git a/td/telegram/Payments.h b/td/telegram/Payments.h index afdd948aa..94afbc93f 100644 --- a/td/telegram/Payments.h +++ b/td/telegram/Payments.h @@ -156,6 +156,4 @@ void delete_saved_credentials(Promise &&promise); void get_bank_card_info(const string &bank_card_number, Promise> &&promise); -// void send_ton_lite_server_request(Slice request, Promise> &&promise); - } // namespace td diff --git a/td/telegram/Td.cpp b/td/telegram/Td.cpp index fd8b7d9f1..012ccecd6 100644 --- a/td/telegram/Td.cpp +++ b/td/telegram/Td.cpp @@ -3282,7 +3282,6 @@ bool Td::is_preauthentication_request(int32 id) { case td_api::setCustomLanguagePackString::ID: case td_api::deleteLanguagePack::ID: case td_api::processPushNotification::ID: - // case td_api::sendTonLiteServerRequest::ID: case td_api::getOption::ID: case td_api::setOption::ID: case td_api::getStorageStatistics::ID: @@ -7305,18 +7304,6 @@ void Td::on_request(uint64 id, const td_api::deleteSavedCredentials &request) { delete_saved_credentials(std::move(promise)); } -// void Td::on_request(uint64 id, const td_api::sendTonLiteServerRequest &request) { -// CHECK_IS_USER(); -// CREATE_REQUEST_PROMISE(); -// send_ton_lite_server_request(request.request_, std::move(promise)); -// } - -// void Td::on_request(uint64 id, const td_api::getTonWalletPasswordSalt &request) { -// CHECK_IS_USER(); -// CREATE_REQUEST_PROMISE(); -// send_closure(password_manager_, &PasswordManager::get_ton_wallet_password_salt, std::move(promise)); -// } - void Td::on_request(uint64 id, td_api::getPassportElement &request) { CHECK_IS_USER(); CLEAN_INPUT_STRING(request.password_); diff --git a/td/telegram/Td.h b/td/telegram/Td.h index 8be781b94..85527c902 100644 --- a/td/telegram/Td.h +++ b/td/telegram/Td.h @@ -973,10 +973,6 @@ class Td final : public NetQueryCallback { void on_request(uint64 id, const td_api::deleteSavedCredentials &request); - // void on_request(uint64 id, const td_api::sendTonLiteServerRequest &request); - - // void on_request(uint64 id, const td_api::getTonWalletPasswordSalt &request); - void on_request(uint64 id, td_api::getPassportElement &request); void on_request(uint64 id, td_api::getAllPassportElements &request);