From da2d81c81bf444ee327c93a6dda1fec215faa3e7 Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 28 Jun 2021 15:55:11 +0300 Subject: [PATCH] Update layer to 131. --- td/generate/scheme/telegram_api.tl | 12 ++++++++++-- td/telegram/AuthManager.cpp | 2 +- td/telegram/PasswordManager.cpp | 6 +++--- td/telegram/UpdatesManager.cpp | 4 ++++ td/telegram/UpdatesManager.h | 1 + td/telegram/Version.h | 2 +- 6 files changed, 20 insertions(+), 7 deletions(-) diff --git a/td/generate/scheme/telegram_api.tl b/td/generate/scheme/telegram_api.tl index 361efc3ce..f41883202 100644 --- a/td/generate/scheme/telegram_api.tl +++ b/td/generate/scheme/telegram_api.tl @@ -366,6 +366,7 @@ updateChatParticipant#f3b3781f flags:# chat_id:int date:int actor_id:int user_id updateChannelParticipant#7fecb1ec flags:# channel_id:int date:int actor_id:int user_id:int prev_participant:flags.0?ChannelParticipant new_participant:flags.1?ChannelParticipant invite:flags.2?ExportedChatInvite qts:int = Update; updateBotStopped#7f9488a user_id:int date:int stopped:Bool qts:int = Update; updateGroupCallConnection#b783982 flags:# presentation:flags.0?true params:DataJSON = Update; +updateBotCommands#cf7e0873 peer:Peer bot_id:int commands:Vector = Update; updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State; @@ -524,7 +525,7 @@ authorization#ad01d61d flags:# current:flags.0?true official_app:flags.1?true pa account.authorizations#1250abde authorizations:Vector = account.Authorizations; -account.password#ad2641f8 flags:# has_recovery:flags.0?true has_secure_values:flags.1?true has_password:flags.2?true current_algo:flags.2?PasswordKdfAlgo srp_B:flags.2?bytes srp_id:flags.2?long hint:flags.3?string email_unconfirmed_pattern:flags.4?string new_algo:PasswordKdfAlgo new_secure_algo:SecurePasswordKdfAlgo secure_random:bytes = account.Password; +account.password#185b184f flags:# has_recovery:flags.0?true has_secure_values:flags.1?true has_password:flags.2?true current_algo:flags.2?PasswordKdfAlgo srp_B:flags.2?bytes srp_id:flags.2?long hint:flags.3?string email_unconfirmed_pattern:flags.4?string new_algo:PasswordKdfAlgo new_secure_algo:SecurePasswordKdfAlgo secure_random:bytes pending_reset_date:flags.5?int = account.Password; account.passwordSettings#9a5c33e5 flags:# email:flags.0?string secure_settings:flags.1?SecureSecretSettings = account.PasswordSettings; @@ -1250,6 +1251,10 @@ botCommandScopePeer#db9d897d peer:InputPeer = BotCommandScope; botCommandScopePeerAdmins#3fd863d1 peer:InputPeer = BotCommandScope; botCommandScopePeerUser#a1321f3 peer:InputPeer user_id:InputUser = BotCommandScope; +account.resetPasswordFailedWait#e3779861 retry_date:int = account.ResetPasswordResult; +account.resetPasswordRequestedWait#e9effc7d until_date:int = account.ResetPasswordResult; +account.resetPasswordOk#e926d63e = account.ResetPasswordResult; + ---functions--- invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X; @@ -1271,13 +1276,14 @@ auth.bindTempAuthKey#cdd42a05 perm_auth_key_id:long nonce:long expires_at:int en auth.importBotAuthorization#67a3ff2c flags:int api_id:int api_hash:string bot_auth_token:string = auth.Authorization; auth.checkPassword#d18b4d16 password:InputCheckPasswordSRP = auth.Authorization; auth.requestPasswordRecovery#d897bc66 = auth.PasswordRecovery; -auth.recoverPassword#4ea56e92 code:string = auth.Authorization; +auth.recoverPassword#37096c70 flags:# code:string new_settings:flags.0?account.PasswordInputSettings = auth.Authorization; auth.resendCode#3ef1a9bf phone_number:string phone_code_hash:string = auth.SentCode; auth.cancelCode#1f040578 phone_number:string phone_code_hash:string = Bool; auth.dropTempAuthKeys#8e48a188 except_auth_keys:Vector = Bool; auth.exportLoginToken#b1b41517 api_id:int api_hash:string except_ids:Vector = auth.LoginToken; auth.importLoginToken#95ac5ce4 token:bytes = auth.LoginToken; auth.acceptLoginToken#e894ad4d token:bytes = Authorization; +auth.checkRecoveryPassword#d36bf79 code:string = Bool; account.registerDevice#68976c6f flags:# no_muted:flags.0?true token_type:int token:string app_sandbox:Bool secret:bytes other_uids:Vector = Bool; account.unregisterDevice#3076c4bf token_type:int token:string other_uids:Vector = Bool; @@ -1347,6 +1353,8 @@ account.getMultiWallPapers#65ad71dc wallpapers:Vector = Vector = Vector; users.getFullUser#ca30a5b1 id:InputUser = UserFull; diff --git a/td/telegram/AuthManager.cpp b/td/telegram/AuthManager.cpp index efb032825..c8a51c311 100644 --- a/td/telegram/AuthManager.cpp +++ b/td/telegram/AuthManager.cpp @@ -332,7 +332,7 @@ void AuthManager::recover_password(uint64 query_id, string code) { on_new_query(query_id); start_net_query(NetQueryType::RecoverPassword, - G()->net_query_creator().create_unauth(telegram_api::auth_recoverPassword(code))); + G()->net_query_creator().create_unauth(telegram_api::auth_recoverPassword(0, code, nullptr))); } void AuthManager::log_out(uint64 query_id) { diff --git a/td/telegram/PasswordManager.cpp b/td/telegram/PasswordManager.cpp index 9750b081e..e6f3b11b1 100644 --- a/td/telegram/PasswordManager.cpp +++ b/td/telegram/PasswordManager.cpp @@ -465,7 +465,7 @@ void PasswordManager::check_email_address_verification_code(string code, Promise void PasswordManager::request_password_recovery( Promise> promise) { - // is called only after authoriation + // is called only after authorization send_with_promise( G()->net_query_creator().create(telegram_api::auth_requestPasswordRecovery()), PromiseCreator::lambda([promise = std::move(promise)](Result r_query) mutable { @@ -479,8 +479,8 @@ void PasswordManager::request_password_recovery( } void PasswordManager::recover_password(string code, Promise promise) { - // is called only after authoriation - send_with_promise(G()->net_query_creator().create(telegram_api::auth_recoverPassword(std::move(code))), + // is called only after authorization + send_with_promise(G()->net_query_creator().create(telegram_api::auth_recoverPassword(0, std::move(code), nullptr)), PromiseCreator::lambda( [actor_id = actor_id(this), promise = std::move(promise)](Result r_query) mutable { auto r_result = fetch_result(std::move(r_query)); diff --git a/td/telegram/UpdatesManager.cpp b/td/telegram/UpdatesManager.cpp index 64cc39b0f..6c702a5ed 100644 --- a/td/telegram/UpdatesManager.cpp +++ b/td/telegram/UpdatesManager.cpp @@ -2613,6 +2613,10 @@ void UpdatesManager::on_update(tl_object_ptr up promise.set_value(Unit()); } +void UpdatesManager::on_update(tl_object_ptr update, Promise &&promise) { + promise.set_value(Unit()); +} + void UpdatesManager::on_update(tl_object_ptr update, Promise &&promise) { td_->contacts_manager_->on_get_chat_participants(std::move(update->participants_), true); promise.set_value(Unit()); diff --git a/td/telegram/UpdatesManager.h b/td/telegram/UpdatesManager.h index d83bad7be..ead54755d 100644 --- a/td/telegram/UpdatesManager.h +++ b/td/telegram/UpdatesManager.h @@ -361,6 +361,7 @@ class UpdatesManager : public Actor { void on_update(tl_object_ptr update, Promise &&promise); void on_update(tl_object_ptr update, Promise &&promise); + void on_update(tl_object_ptr update, Promise &&promise); void on_update(tl_object_ptr update, Promise &&promise); void on_update(tl_object_ptr update, Promise &&promise); diff --git a/td/telegram/Version.h b/td/telegram/Version.h index 33f2f9050..4b16656e1 100644 --- a/td/telegram/Version.h +++ b/td/telegram/Version.h @@ -8,7 +8,7 @@ namespace td { -constexpr int32 MTPROTO_LAYER = 130; +constexpr int32 MTPROTO_LAYER = 131; enum class Version : int32 { Initial, // 0