Update layer 109. TON-related requests was removed.

GitOrigin-RevId: 7b6cba050a43aab728928e145829a402a055df52
This commit is contained in:
levlam 2020-01-20 01:52:46 +03:00
parent 359153c212
commit 16bf911dde
12 changed files with 21 additions and 52 deletions

View File

@ -156,17 +156,7 @@ Changes in 1.6.0:
the appropriate mark.
* Added the field `video_upload_bitrate` to the class `autoDownloadSettings`.
* Disallowed to call `setChatNotificationSettings` method on the chat with self, which never worked.
* Added support for integration with TON Blockchain. For a complete integration use `tonlib` from
https://github.com/ton-blockchain/ton:
- Added the option `default_ton_blockchain_config`, containing the default TON Blockchain config. If empty,
TON integration is disabled, otherwise the config needs to be passed to tonlib.
- Added the option `default_ton_blockchain_name`, containing the default TON Blockchain name.
The blockchain name needs to be passed to tonlib.
- Added the class `tonLiteServerResponse` and the method `sendTonLiteServerRequest`, which allows to send requests to
a TON Blockchain Lite Server through Telegram servers.
- Added the class `tonWalletPasswordSalt` and the method `getTonWalletPasswordSalt`, which can be used
to harden protection of the locally stored TON Blockchain private key.
- Added support for `ton://` URLs in messages and inline keyboard buttons.
* Added support for `ton://` URLs in messages and inline keyboard buttons.
-----------------------------------------------------------------------------------------------------------------------

View File

@ -1945,13 +1945,6 @@ gameHighScore position:int32 user_id:int32 score:int32 = GameHighScore;
gameHighScores scores:vector<gameHighScore> = GameHighScores;
//@description Contains the response of a request to TON lite server @response The response
tonLiteServerResponse response:bytes = TonLiteServerResponse;
//@description Contains the salt to be used with locally stored password to access a local TON-based wallet @salt The salt
tonWalletPasswordSalt salt:bytes = TonWalletPasswordSalt;
//@class ChatEventAction @description Represents a chat event
//@description A message was edited @old_message The original message before the edit @new_message The message after it was edited
@ -4231,13 +4224,6 @@ sendCustomRequest method:string parameters:string = CustomRequestResult;
answerCustomQuery custom_query_id:int64 data:string = Ok;
//@description Sends a request to TON lite server through Telegram servers. Can be called before authorization @request The request
sendTonLiteServerRequest request:bytes = TonLiteServerResponse;
//@description Returns a salt to be used with locally stored password to access a local TON-based wallet
getTonWalletPasswordSalt = TonWalletPasswordSalt;
//@description Succeeds after a specified amount of time has passed. Can be called before authorization. Can be called before initialization @seconds Number of seconds before the function returns
setAlarm seconds:double = Ok;

Binary file not shown.

View File

@ -1071,10 +1071,6 @@ theme#28f1114 flags:# creator:flags.0?true default:flags.1?true id:long access_h
account.themesNotModified#f41eb622 = account.Themes;
account.themes#7f676421 hash:int themes:Vector<Theme> = account.Themes;
wallet.liteResponse#764386d7 response:bytes = wallet.LiteResponse;
wallet.secretSalt#dd484d64 salt:bytes = wallet.KeySecretSalt;
auth.loginToken#629f1980 expires:int token:bytes = auth.LoginToken;
auth.loginTokenMigrateTo#68e9916 dc_id:int token:bytes = auth.LoginToken;
auth.loginTokenSuccess#390d5c5e authorization:auth.Authorization = auth.LoginToken;
@ -1445,6 +1441,3 @@ langpack.getLanguage#6a596502 lang_pack:string lang_code:string = LangPackLangua
folders.editPeerFolders#6847d0ab folder_peers:Vector<InputFolderPeer> = Updates;
folders.deleteFolder#1c295881 folder_id:int = Updates;
wallet.sendLiteRequest#e2c9d33e body:bytes = wallet.LiteResponse;
wallet.getKeySecretSalt#b57f346 revoke:Bool = wallet.KeySecretSalt;

Binary file not shown.

View File

@ -734,7 +734,7 @@ void PasswordManager::drop_cached_secret() {
LOG(INFO) << "Drop passport secret";
secret_ = optional<secure_storage::Secret>();
}
/*
void PasswordManager::get_ton_wallet_password_salt(Promise<td_api::object_ptr<td_api::tonWalletPasswordSalt>> promise) {
if (!ton_wallet_password_salt_.empty()) {
return promise.set_value(td_api::make_object<td_api::tonWalletPasswordSalt>(ton_wallet_password_salt_));
@ -768,7 +768,7 @@ void PasswordManager::on_get_ton_wallet_password_salt(
}
}
}
*/
void PasswordManager::timeout_expired() {
if (Time::now() >= secret_expire_date_) {
drop_cached_secret();

View File

@ -89,7 +89,7 @@ class PasswordManager : public NetQueryCallback {
static TempPasswordState get_temp_password_state_sync();
void get_ton_wallet_password_salt(Promise<td_api::object_ptr<td_api::tonWalletPasswordSalt>> promise);
// void get_ton_wallet_password_salt(Promise<td_api::object_ptr<td_api::tonWalletPasswordSalt>> promise);
private:
static constexpr size_t MIN_NEW_SALT_SIZE = 8;
@ -162,8 +162,8 @@ class PasswordManager : public NetQueryCallback {
int32 last_code_length_ = 0;
string ton_wallet_password_salt_;
vector<Promise<td_api::object_ptr<td_api::tonWalletPasswordSalt>>> get_ton_wallet_password_salt_queries_;
// string ton_wallet_password_salt_;
// vector<Promise<td_api::object_ptr<td_api::tonWalletPasswordSalt>>> get_ton_wallet_password_salt_queries_;
static Result<secure_storage::Secret> decrypt_secure_secret(
Slice password, tl_object_ptr<telegram_api::SecurePasswordKdfAlgo> algo_ptr, Slice secret, int64 secret_id);
@ -191,7 +191,7 @@ class PasswordManager : public NetQueryCallback {
Promise<TempPasswordState> promise);
void on_finish_create_temp_password(Result<TempPasswordState> result, bool dummy);
void on_get_ton_wallet_password_salt(Result<telegram_api::object_ptr<telegram_api::wallet_secretSalt>> result);
// void on_get_ton_wallet_password_salt(Result<telegram_api::object_ptr<telegram_api::wallet_secretSalt>> result);
void on_result(NetQueryPtr query) override;

View File

@ -486,7 +486,7 @@ class ClearSavedInfoQuery : public Td::ResultHandler {
promise_.set_error(std::move(status));
}
};
/*
class SendLiteRequestQuery : public Td::ResultHandler {
Promise<td_api::object_ptr<td_api::tonLiteServerResponse>> promise_;
@ -514,7 +514,7 @@ class SendLiteRequestQuery : public Td::ResultHandler {
promise_.set_error(std::move(status));
}
};
*/
bool operator==(const LabeledPricePart &lhs, const LabeledPricePart &rhs) {
return lhs.label == rhs.label && lhs.amount == rhs.amount;
}
@ -896,9 +896,9 @@ void delete_saved_order_info(Promise<Unit> &&promise) {
void delete_saved_credentials(Promise<Unit> &&promise) {
G()->td().get_actor_unsafe()->create_handler<ClearSavedInfoQuery>(std::move(promise))->send(true, false);
}
/*
void send_ton_lite_server_request(Slice request, Promise<td_api::object_ptr<td_api::tonLiteServerResponse>> &&promise) {
G()->td().get_actor_unsafe()->create_handler<SendLiteRequestQuery>(std::move(promise))->send(BufferSlice{request});
}
*/
} // namespace td

View File

@ -154,6 +154,6 @@ void delete_saved_order_info(Promise<Unit> &&promise);
void delete_saved_credentials(Promise<Unit> &&promise);
void send_ton_lite_server_request(Slice request, Promise<td_api::object_ptr<td_api::tonLiteServerResponse>> &&promise);
// void send_ton_lite_server_request(Slice request, Promise<td_api::object_ptr<td_api::tonLiteServerResponse>> &&promise);
} // namespace td

View File

@ -3515,7 +3515,7 @@ 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::sendTonLiteServerRequest::ID:
case td_api::getOption::ID:
case td_api::setOption::ID:
case td_api::getStorageStatistics::ID:
@ -7379,7 +7379,7 @@ void Td::on_request(uint64 id, const td_api::deleteSavedCredentials &request) {
CREATE_OK_REQUEST_PROMISE();
delete_saved_credentials(std::move(promise));
}
/*
void Td::on_request(uint64 id, const td_api::sendTonLiteServerRequest &request) {
CHECK_IS_USER();
CREATE_REQUEST_PROMISE();
@ -7391,7 +7391,7 @@ void Td::on_request(uint64 id, const td_api::getTonWalletPasswordSalt &request)
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_);

View File

@ -941,9 +941,9 @@ 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::sendTonLiteServerRequest &request);
void on_request(uint64 id, const td_api::getTonWalletPasswordSalt &request);
// void on_request(uint64 id, const td_api::getTonWalletPasswordSalt &request);
void on_request(uint64 id, td_api::getPassportElement &request);

View File

@ -1627,10 +1627,10 @@ class CliClient final : public Actor {
send_request(td_api::make_object<td_api::deleteSavedOrderInfo>());
} else if (op == "dsc") {
send_request(td_api::make_object<td_api::deleteSavedCredentials>());
} else if (op == "stlsr") {
send_request(td_api::make_object<td_api::sendTonLiteServerRequest>());
} else if (op == "gtwps") {
send_request(td_api::make_object<td_api::getTonWalletPasswordSalt>());
// } else if (op == "stlsr") {
// send_request(td_api::make_object<td_api::sendTonLiteServerRequest>());
// } else if (op == "gtwps") {
// send_request(td_api::make_object<td_api::getTonWalletPasswordSalt>());
} else if (op == "gpr") {
send_request(td_api::make_object<td_api::getUserPrivacySettingRules>(get_user_privacy_setting(args)));
} else if (op == "spr") {