Combine phone number verification methods into a single API method.
This commit is contained in:
parent
99d8de1e88
commit
25958fb406
@ -383,7 +383,7 @@ function split_file($file, $chunks, $undo) {
|
|||||||
'option_manager[_(-](?![.]get[(][)])|OptionManager' => 'OptionManager',
|
'option_manager[_(-](?![.]get[(][)])|OptionManager' => 'OptionManager',
|
||||||
'password_manager[_(-](?![.]get[(][)])|PasswordManager' => 'PasswordManager',
|
'password_manager[_(-](?![.]get[(][)])|PasswordManager' => 'PasswordManager',
|
||||||
'people_nearby_manager[_(-](?![.]get[(][)])|PeopleNearbyManager' => 'PeopleNearbyManager',
|
'people_nearby_manager[_(-](?![.]get[(][)])|PeopleNearbyManager' => 'PeopleNearbyManager',
|
||||||
'[a-z_]*phone_number_manager[_(-](?![.]get[(][)])|PhoneNumberManager' => 'PhoneNumberManager',
|
'phone_number_manager[_(-](?![.]get[(][)])|PhoneNumberManager' => 'PhoneNumberManager',
|
||||||
'PhotoSizeSource' => 'PhotoSizeSource',
|
'PhotoSizeSource' => 'PhotoSizeSource',
|
||||||
'poll_manager[_(-](?![.]get[(][)])|PollManager' => 'PollManager',
|
'poll_manager[_(-](?![.]get[(][)])|PollManager' => 'PollManager',
|
||||||
'privacy_manager[_(-](?![.]get[(][)])|PrivacyManager' => 'PrivacyManager',
|
'privacy_manager[_(-](?![.]get[(][)])|PrivacyManager' => 'PrivacyManager',
|
||||||
|
@ -6039,8 +6039,8 @@ internalLinkTypeMessageDraft text:formattedText contains_link:Bool = InternalLin
|
|||||||
//-If empty, then onActivityResult method must be used to return response on Android, or the link tgbot{bot_user_id}://passport/success or tgbot{bot_user_id}://passport/cancel must be opened otherwise
|
//-If empty, then onActivityResult method must be used to return response on Android, or the link tgbot{bot_user_id}://passport/success or tgbot{bot_user_id}://passport/cancel must be opened otherwise
|
||||||
internalLinkTypePassportDataRequest bot_user_id:int53 scope:string public_key:string nonce:string callback_url:string = InternalLinkType;
|
internalLinkTypePassportDataRequest bot_user_id:int53 scope:string public_key:string nonce:string callback_url:string = InternalLinkType;
|
||||||
|
|
||||||
//@description The link can be used to confirm ownership of a phone number to prevent account deletion. Call sendPhoneNumberConfirmationCode with the given hash and phone number to process the link.
|
//@description The link can be used to confirm ownership of a phone number to prevent account deletion. Call sendPhoneNumberCode with the given phone number and with phoneNumberCodeTypeConfirmOwnership with the given hash to process the link.
|
||||||
//-If succeeded, call checkPhoneNumberConfirmationCode to check entered by the user code, or resendPhoneNumberConfirmationCode to resend it
|
//-If succeeded, call checkPhoneNumberCode to check entered by the user code, or resendPhoneNumberCode to resend it
|
||||||
//@hash Hash value from the link
|
//@hash Hash value from the link
|
||||||
//@phone_number Phone number value from the link
|
//@phone_number Phone number value from the link
|
||||||
internalLinkTypePhoneNumberConfirmation hash:string phone_number:string = InternalLinkType;
|
internalLinkTypePhoneNumberConfirmation hash:string phone_number:string = InternalLinkType;
|
||||||
@ -6730,6 +6730,19 @@ botCommandScopeChatAdministrators chat_id:int53 = BotCommandScope;
|
|||||||
botCommandScopeChatMember chat_id:int53 user_id:int53 = BotCommandScope;
|
botCommandScopeChatMember chat_id:int53 user_id:int53 = BotCommandScope;
|
||||||
|
|
||||||
|
|
||||||
|
//@class PhoneNumberCodeType @description Describes type of the request for which a code is sent to a phone number
|
||||||
|
|
||||||
|
//@description Checks ownership of a new phone number to change the user's authentication phone number; for official Android and iOS applications only.
|
||||||
|
phoneNumberCodeTypeChange = PhoneNumberCodeType;
|
||||||
|
|
||||||
|
//@description Verifies ownership of a phone number to be added to the user's Telegram Passport
|
||||||
|
phoneNumberCodeTypeVerify = PhoneNumberCodeType;
|
||||||
|
|
||||||
|
//@description Confirms ownership of a phone number to prevent account deletion while handling links of the type internalLinkTypePhoneNumberConfirmation
|
||||||
|
//@hash Hash value from the link
|
||||||
|
phoneNumberCodeTypeConfirmOwnership hash:string = PhoneNumberCodeType;
|
||||||
|
|
||||||
|
|
||||||
//@class Update @description Contains notifications about data changes
|
//@class Update @description Contains notifications about data changes
|
||||||
|
|
||||||
//@description The user authorization state has changed @authorization_state New authorization state
|
//@description The user authorization state has changed @authorization_state New authorization state
|
||||||
@ -9754,16 +9767,17 @@ setBusinessAwayMessageSettings away_message_settings:businessAwayMessageSettings
|
|||||||
setBusinessStartPage start_page:inputBusinessStartPage = Ok;
|
setBusinessStartPage start_page:inputBusinessStartPage = Ok;
|
||||||
|
|
||||||
|
|
||||||
//@description Changes the phone number of the user and sends an authentication code to the user's new phone number; for official Android and iOS applications only. On success, returns information about the sent code
|
//@description Sends a code to the specified phone number. Aborts previous phone number verification if any. On success, returns information about the sent code
|
||||||
//@phone_number The new phone number of the user in international format
|
//@phone_number The phone number, in international format
|
||||||
//@settings Settings for the authentication of the user's phone number; pass null to use default settings
|
//@settings Settings for the authentication of the user's phone number; pass null to use default settings
|
||||||
changePhoneNumber phone_number:string settings:phoneNumberAuthenticationSettings = AuthenticationCodeInfo;
|
//@type Type of the request for which the code is sent
|
||||||
|
sendPhoneNumberCode phone_number:string settings:phoneNumberAuthenticationSettings type:PhoneNumberCodeType = AuthenticationCodeInfo;
|
||||||
|
|
||||||
//@description Resends the authentication code sent to confirm a new phone number for the current user. Works only if the previously received authenticationCodeInfo next_code_type was not null and the server-specified timeout has passed
|
//@description Resends the authentication code sent to a phone number. Works only if the previously received authenticationCodeInfo next_code_type was not null and the server-specified timeout has passed
|
||||||
resendChangePhoneNumberCode = AuthenticationCodeInfo;
|
resendPhoneNumberCode = AuthenticationCodeInfo;
|
||||||
|
|
||||||
//@description Checks the authentication code sent to confirm a new phone number of the user @code Authentication code to check
|
//@description Check the authentication code and completes the request for which the code was sent if appropriate @code Authentication code to check
|
||||||
checkChangePhoneNumberCode code:string = Ok;
|
checkPhoneNumberCode code:string = Ok;
|
||||||
|
|
||||||
|
|
||||||
//@description Returns the business bot that is connected to the current user account. Returns a 404 error if there is no connected bot
|
//@description Returns the business bot that is connected to the current user account. Returns a 404 error if there is no connected bot
|
||||||
@ -10340,18 +10354,6 @@ setPassportElementErrors user_id:int53 errors:vector<inputPassportElementError>
|
|||||||
getPreferredCountryLanguage country_code:string = Text;
|
getPreferredCountryLanguage country_code:string = Text;
|
||||||
|
|
||||||
|
|
||||||
//@description Sends a code to verify a phone number to be added to a user's Telegram Passport
|
|
||||||
//@phone_number The phone number of the user, in international format
|
|
||||||
//@settings Settings for the authentication of the user's phone number; pass null to use default settings
|
|
||||||
sendPhoneNumberVerificationCode phone_number:string settings:phoneNumberAuthenticationSettings = AuthenticationCodeInfo;
|
|
||||||
|
|
||||||
//@description Resends the code to verify a phone number to be added to a user's Telegram Passport
|
|
||||||
resendPhoneNumberVerificationCode = AuthenticationCodeInfo;
|
|
||||||
|
|
||||||
//@description Checks the phone number verification code for Telegram Passport @code Verification code to check
|
|
||||||
checkPhoneNumberVerificationCode code:string = Ok;
|
|
||||||
|
|
||||||
|
|
||||||
//@description Sends a code to verify an email address to be added to a user's Telegram Passport @email_address Email address
|
//@description Sends a code to verify an email address to be added to a user's Telegram Passport @email_address Email address
|
||||||
sendEmailAddressVerificationCode email_address:string = EmailAddressAuthenticationCodeInfo;
|
sendEmailAddressVerificationCode email_address:string = EmailAddressAuthenticationCodeInfo;
|
||||||
|
|
||||||
@ -10380,19 +10382,6 @@ getPassportAuthorizationFormAvailableElements authorization_form_id:int32 passwo
|
|||||||
sendPassportAuthorizationForm authorization_form_id:int32 types:vector<PassportElementType> = Ok;
|
sendPassportAuthorizationForm authorization_form_id:int32 types:vector<PassportElementType> = Ok;
|
||||||
|
|
||||||
|
|
||||||
//@description Sends phone number confirmation code to handle links of the type internalLinkTypePhoneNumberConfirmation
|
|
||||||
//@hash Hash value from the link
|
|
||||||
//@phone_number Phone number value from the link
|
|
||||||
//@settings Settings for the authentication of the user's phone number; pass null to use default settings
|
|
||||||
sendPhoneNumberConfirmationCode hash:string phone_number:string settings:phoneNumberAuthenticationSettings = AuthenticationCodeInfo;
|
|
||||||
|
|
||||||
//@description Resends phone number confirmation code
|
|
||||||
resendPhoneNumberConfirmationCode = AuthenticationCodeInfo;
|
|
||||||
|
|
||||||
//@description Checks phone number confirmation code @code Confirmation code to check
|
|
||||||
checkPhoneNumberConfirmationCode code:string = Ok;
|
|
||||||
|
|
||||||
|
|
||||||
//@description Informs the server about the number of pending bot updates if they haven't been processed for a long time; for bots only @pending_update_count The number of pending updates @error_message The last error message
|
//@description Informs the server about the number of pending bot updates if they haven't been processed for a long time; for bots only @pending_update_count The number of pending updates @error_message The last error message
|
||||||
setBotUpdatesStatus pending_update_count:int32 error_message:string = Ok;
|
setBotUpdatesStatus pending_update_count:int32 error_message:string = Ok;
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
#include "td/telegram/ConfigManager.h"
|
#include "td/telegram/ConfigManager.h"
|
||||||
#include "td/telegram/Global.h"
|
#include "td/telegram/Global.h"
|
||||||
|
#include "td/telegram/misc.h"
|
||||||
#include "td/telegram/SuggestedAction.h"
|
#include "td/telegram/SuggestedAction.h"
|
||||||
#include "td/telegram/Td.h"
|
#include "td/telegram/Td.h"
|
||||||
#include "td/telegram/telegram_api.h"
|
#include "td/telegram/telegram_api.h"
|
||||||
@ -180,45 +181,47 @@ void PhoneNumberManager::on_send_code_result(Result<telegram_api::object_ptr<tel
|
|||||||
promise.set_value(send_code_helper_.get_authentication_code_info_object());
|
promise.set_value(send_code_helper_.get_authentication_code_info_object());
|
||||||
}
|
}
|
||||||
|
|
||||||
void PhoneNumberManager::set_phone_number(Type type, string phone_number,
|
void PhoneNumberManager::set_phone_number(string phone_number,
|
||||||
td_api::object_ptr<td_api::phoneNumberAuthenticationSettings> settings,
|
td_api::object_ptr<td_api::phoneNumberAuthenticationSettings> settings,
|
||||||
|
td_api::object_ptr<td_api::PhoneNumberCodeType> type,
|
||||||
Promise<td_api::object_ptr<td_api::authenticationCodeInfo>> &&promise) {
|
Promise<td_api::object_ptr<td_api::authenticationCodeInfo>> &&promise) {
|
||||||
|
inc_generation();
|
||||||
if (phone_number.empty()) {
|
if (phone_number.empty()) {
|
||||||
return promise.set_error(Status::Error(400, "Phone number must be non-empty"));
|
return promise.set_error(Status::Error(400, "Phone number must be non-empty"));
|
||||||
}
|
}
|
||||||
|
if (type == nullptr) {
|
||||||
|
return promise.set_error(Status::Error(400, "Type must be non-empty"));
|
||||||
|
}
|
||||||
|
|
||||||
inc_generation();
|
switch (type->get_id()) {
|
||||||
type_ = type;
|
case td_api::phoneNumberCodeTypeChange::ID:
|
||||||
switch (type_) {
|
type_ = Type::ChangePhone;
|
||||||
case Type::ChangePhone:
|
|
||||||
send_closure(G()->config_manager(), &ConfigManager::hide_suggested_action,
|
send_closure(G()->config_manager(), &ConfigManager::hide_suggested_action,
|
||||||
SuggestedAction{SuggestedAction::Type::CheckPhoneNumber});
|
SuggestedAction{SuggestedAction::Type::CheckPhoneNumber});
|
||||||
return send_new_send_code_query(send_code_helper_.send_change_phone_code(phone_number, settings),
|
return send_new_send_code_query(send_code_helper_.send_change_phone_code(phone_number, settings),
|
||||||
std::move(promise));
|
std::move(promise));
|
||||||
case Type::VerifyPhone:
|
case td_api::phoneNumberCodeTypeVerify::ID:
|
||||||
|
type_ = Type::VerifyPhone;
|
||||||
return send_new_send_code_query(send_code_helper_.send_verify_phone_code(phone_number, settings),
|
return send_new_send_code_query(send_code_helper_.send_verify_phone_code(phone_number, settings),
|
||||||
std::move(promise));
|
std::move(promise));
|
||||||
case Type::ConfirmPhone:
|
case td_api::phoneNumberCodeTypeConfirmOwnership::ID: {
|
||||||
|
auto hash = std::move(static_cast<td_api::phoneNumberCodeTypeConfirmOwnership *>(type.get())->hash_);
|
||||||
|
if (!clean_input_string(hash)) {
|
||||||
|
return promise.set_error(Status::Error(400, "Hash must be encoded in UTF-8"));
|
||||||
|
}
|
||||||
|
if (hash.empty()) {
|
||||||
|
return promise.set_error(Status::Error(400, "Hash must be non-empty"));
|
||||||
|
}
|
||||||
|
|
||||||
|
type_ = Type::ConfirmPhone;
|
||||||
|
return send_new_send_code_query(send_code_helper_.send_confirm_phone_code(hash, phone_number, settings),
|
||||||
|
std::move(promise));
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PhoneNumberManager::set_phone_number_and_hash(
|
|
||||||
string hash, string phone_number, td_api::object_ptr<td_api::phoneNumberAuthenticationSettings> settings,
|
|
||||||
Promise<td_api::object_ptr<td_api::authenticationCodeInfo>> &&promise) {
|
|
||||||
if (phone_number.empty()) {
|
|
||||||
return promise.set_error(Status::Error(400, "Phone number must be non-empty"));
|
|
||||||
}
|
|
||||||
if (hash.empty()) {
|
|
||||||
return promise.set_error(Status::Error(400, "Hash must be non-empty"));
|
|
||||||
}
|
|
||||||
|
|
||||||
inc_generation();
|
|
||||||
type_ = Type::ConfirmPhone;
|
|
||||||
send_new_send_code_query(send_code_helper_.send_confirm_phone_code(hash, phone_number, settings), std::move(promise));
|
|
||||||
}
|
|
||||||
|
|
||||||
void PhoneNumberManager::resend_authentication_code(
|
void PhoneNumberManager::resend_authentication_code(
|
||||||
Promise<td_api::object_ptr<td_api::authenticationCodeInfo>> &&promise) {
|
Promise<td_api::object_ptr<td_api::authenticationCodeInfo>> &&promise) {
|
||||||
if (state_ != State::WaitCode) {
|
if (state_ != State::WaitCode) {
|
||||||
|
@ -23,21 +23,16 @@ class PhoneNumberManager final : public Actor {
|
|||||||
public:
|
public:
|
||||||
PhoneNumberManager(Td *td, ActorShared<> parent);
|
PhoneNumberManager(Td *td, ActorShared<> parent);
|
||||||
|
|
||||||
enum class Type : int32 { ChangePhone, VerifyPhone, ConfirmPhone };
|
void set_phone_number(string phone_number, td_api::object_ptr<td_api::phoneNumberAuthenticationSettings> settings,
|
||||||
|
td_api::object_ptr<td_api::PhoneNumberCodeType> type,
|
||||||
void set_phone_number(Type type, string phone_number,
|
|
||||||
td_api::object_ptr<td_api::phoneNumberAuthenticationSettings> settings,
|
|
||||||
Promise<td_api::object_ptr<td_api::authenticationCodeInfo>> &&promise);
|
Promise<td_api::object_ptr<td_api::authenticationCodeInfo>> &&promise);
|
||||||
|
|
||||||
void set_phone_number_and_hash(string hash, string phone_number,
|
|
||||||
td_api::object_ptr<td_api::phoneNumberAuthenticationSettings> settings,
|
|
||||||
Promise<td_api::object_ptr<td_api::authenticationCodeInfo>> &&promise);
|
|
||||||
|
|
||||||
void resend_authentication_code(Promise<td_api::object_ptr<td_api::authenticationCodeInfo>> &&promise);
|
void resend_authentication_code(Promise<td_api::object_ptr<td_api::authenticationCodeInfo>> &&promise);
|
||||||
|
|
||||||
void check_code(string code, Promise<Unit> &&promise);
|
void check_code(string code, Promise<Unit> &&promise);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
enum class Type : int32 { ChangePhone, VerifyPhone, ConfirmPhone };
|
||||||
enum class State : int32 { Ok, WaitCode } state_ = State::Ok;
|
enum class State : int32 { Ok, WaitCode } state_ = State::Ok;
|
||||||
|
|
||||||
void tear_down() final;
|
void tear_down() final;
|
||||||
|
@ -4610,27 +4610,27 @@ void Td::on_request(uint64 id, td_api::deleteAccount &request) {
|
|||||||
send_closure(auth_manager_actor_, &AuthManager::delete_account, id, request.reason_, request.password_);
|
send_closure(auth_manager_actor_, &AuthManager::delete_account, id, request.reason_, request.password_);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Td::on_request(uint64 id, td_api::changePhoneNumber &request) {
|
void Td::on_request(uint64 id, td_api::sendPhoneNumberCode &request) {
|
||||||
CHECK_IS_USER();
|
CHECK_IS_USER();
|
||||||
CLEAN_INPUT_STRING(request.phone_number_);
|
CLEAN_INPUT_STRING(request.phone_number_);
|
||||||
CREATE_REQUEST_PROMISE();
|
CREATE_REQUEST_PROMISE();
|
||||||
phone_number_manager_->set_phone_number(PhoneNumberManager::Type::ChangePhone, std::move(request.phone_number_),
|
phone_number_manager_->set_phone_number(std::move(request.phone_number_), std::move(request.settings_),
|
||||||
std::move(request.settings_), std::move(promise));
|
std::move(request.type_), std::move(promise));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Td::on_request(uint64 id, td_api::checkChangePhoneNumberCode &request) {
|
void Td::on_request(uint64 id, const td_api::resendPhoneNumberCode &request) {
|
||||||
|
CHECK_IS_USER();
|
||||||
|
CREATE_REQUEST_PROMISE();
|
||||||
|
phone_number_manager_->resend_authentication_code(std::move(promise));
|
||||||
|
}
|
||||||
|
|
||||||
|
void Td::on_request(uint64 id, td_api::checkPhoneNumberCode &request) {
|
||||||
CHECK_IS_USER();
|
CHECK_IS_USER();
|
||||||
CLEAN_INPUT_STRING(request.code_);
|
CLEAN_INPUT_STRING(request.code_);
|
||||||
CREATE_OK_REQUEST_PROMISE();
|
CREATE_OK_REQUEST_PROMISE();
|
||||||
phone_number_manager_->check_code(std::move(request.code_), std::move(promise));
|
phone_number_manager_->check_code(std::move(request.code_), std::move(promise));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Td::on_request(uint64 id, td_api::resendChangePhoneNumberCode &request) {
|
|
||||||
CHECK_IS_USER();
|
|
||||||
CREATE_REQUEST_PROMISE();
|
|
||||||
phone_number_manager_->resend_authentication_code(std::move(promise));
|
|
||||||
}
|
|
||||||
|
|
||||||
void Td::on_request(uint64 id, const td_api::getUserLink &request) {
|
void Td::on_request(uint64 id, const td_api::getUserLink &request) {
|
||||||
CHECK_IS_USER();
|
CHECK_IS_USER();
|
||||||
CREATE_REQUEST_PROMISE();
|
CREATE_REQUEST_PROMISE();
|
||||||
@ -9088,27 +9088,6 @@ void Td::on_request(uint64 id, td_api::getPreferredCountryLanguage &request) {
|
|||||||
std::move(promise));
|
std::move(promise));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Td::on_request(uint64 id, td_api::sendPhoneNumberVerificationCode &request) {
|
|
||||||
CHECK_IS_USER();
|
|
||||||
CLEAN_INPUT_STRING(request.phone_number_);
|
|
||||||
CREATE_REQUEST_PROMISE();
|
|
||||||
phone_number_manager_->set_phone_number(PhoneNumberManager::Type::VerifyPhone, std::move(request.phone_number_),
|
|
||||||
std::move(request.settings_), std::move(promise));
|
|
||||||
}
|
|
||||||
|
|
||||||
void Td::on_request(uint64 id, const td_api::resendPhoneNumberVerificationCode &request) {
|
|
||||||
CHECK_IS_USER();
|
|
||||||
CREATE_REQUEST_PROMISE();
|
|
||||||
phone_number_manager_->resend_authentication_code(std::move(promise));
|
|
||||||
}
|
|
||||||
|
|
||||||
void Td::on_request(uint64 id, td_api::checkPhoneNumberVerificationCode &request) {
|
|
||||||
CHECK_IS_USER();
|
|
||||||
CLEAN_INPUT_STRING(request.code_);
|
|
||||||
CREATE_OK_REQUEST_PROMISE();
|
|
||||||
phone_number_manager_->check_code(std::move(request.code_), std::move(promise));
|
|
||||||
}
|
|
||||||
|
|
||||||
void Td::on_request(uint64 id, td_api::sendEmailAddressVerificationCode &request) {
|
void Td::on_request(uint64 id, td_api::sendEmailAddressVerificationCode &request) {
|
||||||
CHECK_IS_USER();
|
CHECK_IS_USER();
|
||||||
CLEAN_INPUT_STRING(request.email_address_);
|
CLEAN_INPUT_STRING(request.email_address_);
|
||||||
@ -9183,28 +9162,6 @@ void Td::on_request(uint64 id, td_api::sendPassportAuthorizationForm &request) {
|
|||||||
get_secure_value_types_td_api(request.types_), std::move(promise));
|
get_secure_value_types_td_api(request.types_), std::move(promise));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Td::on_request(uint64 id, td_api::sendPhoneNumberConfirmationCode &request) {
|
|
||||||
CHECK_IS_USER();
|
|
||||||
CLEAN_INPUT_STRING(request.phone_number_);
|
|
||||||
CLEAN_INPUT_STRING(request.hash_);
|
|
||||||
CREATE_REQUEST_PROMISE();
|
|
||||||
phone_number_manager_->set_phone_number_and_hash(std::move(request.hash_), std::move(request.phone_number_),
|
|
||||||
std::move(request.settings_), std::move(promise));
|
|
||||||
}
|
|
||||||
|
|
||||||
void Td::on_request(uint64 id, const td_api::resendPhoneNumberConfirmationCode &request) {
|
|
||||||
CHECK_IS_USER();
|
|
||||||
CREATE_REQUEST_PROMISE();
|
|
||||||
phone_number_manager_->resend_authentication_code(std::move(promise));
|
|
||||||
}
|
|
||||||
|
|
||||||
void Td::on_request(uint64 id, td_api::checkPhoneNumberConfirmationCode &request) {
|
|
||||||
CHECK_IS_USER();
|
|
||||||
CLEAN_INPUT_STRING(request.code_);
|
|
||||||
CREATE_OK_REQUEST_PROMISE();
|
|
||||||
phone_number_manager_->check_code(std::move(request.code_), std::move(promise));
|
|
||||||
}
|
|
||||||
|
|
||||||
void Td::on_request(uint64 id, const td_api::getSupportUser &request) {
|
void Td::on_request(uint64 id, const td_api::getSupportUser &request) {
|
||||||
CHECK_IS_USER();
|
CHECK_IS_USER();
|
||||||
CREATE_REQUEST_PROMISE();
|
CREATE_REQUEST_PROMISE();
|
||||||
|
@ -567,11 +567,11 @@ class Td final : public Actor {
|
|||||||
|
|
||||||
void on_request(uint64 id, td_api::deleteAccount &request);
|
void on_request(uint64 id, td_api::deleteAccount &request);
|
||||||
|
|
||||||
void on_request(uint64 id, td_api::changePhoneNumber &request);
|
void on_request(uint64 id, td_api::sendPhoneNumberCode &request);
|
||||||
|
|
||||||
void on_request(uint64 id, td_api::checkChangePhoneNumberCode &request);
|
void on_request(uint64 id, const td_api::resendPhoneNumberCode &request);
|
||||||
|
|
||||||
void on_request(uint64 id, td_api::resendChangePhoneNumberCode &request);
|
void on_request(uint64 id, td_api::checkPhoneNumberCode &request);
|
||||||
|
|
||||||
void on_request(uint64 id, const td_api::getUserLink &request);
|
void on_request(uint64 id, const td_api::getUserLink &request);
|
||||||
|
|
||||||
@ -1737,12 +1737,6 @@ class Td final : public Actor {
|
|||||||
|
|
||||||
void on_request(uint64 id, td_api::getPreferredCountryLanguage &request);
|
void on_request(uint64 id, td_api::getPreferredCountryLanguage &request);
|
||||||
|
|
||||||
void on_request(uint64 id, td_api::sendPhoneNumberVerificationCode &request);
|
|
||||||
|
|
||||||
void on_request(uint64 id, const td_api::resendPhoneNumberVerificationCode &request);
|
|
||||||
|
|
||||||
void on_request(uint64 id, td_api::checkPhoneNumberVerificationCode &request);
|
|
||||||
|
|
||||||
void on_request(uint64 id, td_api::sendEmailAddressVerificationCode &request);
|
void on_request(uint64 id, td_api::sendEmailAddressVerificationCode &request);
|
||||||
|
|
||||||
void on_request(uint64 id, const td_api::resendEmailAddressVerificationCode &request);
|
void on_request(uint64 id, const td_api::resendEmailAddressVerificationCode &request);
|
||||||
@ -1755,12 +1749,6 @@ class Td final : public Actor {
|
|||||||
|
|
||||||
void on_request(uint64 id, td_api::sendPassportAuthorizationForm &request);
|
void on_request(uint64 id, td_api::sendPassportAuthorizationForm &request);
|
||||||
|
|
||||||
void on_request(uint64 id, td_api::sendPhoneNumberConfirmationCode &request);
|
|
||||||
|
|
||||||
void on_request(uint64 id, const td_api::resendPhoneNumberConfirmationCode &request);
|
|
||||||
|
|
||||||
void on_request(uint64 id, td_api::checkPhoneNumberConfirmationCode &request);
|
|
||||||
|
|
||||||
void on_request(uint64 id, const td_api::getSupportUser &request);
|
void on_request(uint64 id, const td_api::getSupportUser &request);
|
||||||
|
|
||||||
void on_request(uint64 id, const td_api::getInstalledBackgrounds &request);
|
void on_request(uint64 id, const td_api::getInstalledBackgrounds &request);
|
||||||
|
@ -2558,12 +2558,6 @@ class CliClient final : public Actor {
|
|||||||
td_api::make_object<td_api::sendPassportAuthorizationForm>(form_id, as_passport_element_types(types)));
|
td_api::make_object<td_api::sendPassportAuthorizationForm>(form_id, as_passport_element_types(types)));
|
||||||
} else if (op == "gpcl") {
|
} else if (op == "gpcl") {
|
||||||
send_request(td_api::make_object<td_api::getPreferredCountryLanguage>(args));
|
send_request(td_api::make_object<td_api::getPreferredCountryLanguage>(args));
|
||||||
} else if (op == "spnvc" || op == "SendPhoneNumberVerificationCode") {
|
|
||||||
send_request(td_api::make_object<td_api::sendPhoneNumberVerificationCode>(args, nullptr));
|
|
||||||
} else if (op == "cpnvc" || op == "CheckPhoneNumberVerificationCode") {
|
|
||||||
send_request(td_api::make_object<td_api::checkPhoneNumberVerificationCode>(args));
|
|
||||||
} else if (op == "rpnvc" || op == "ResendPhoneNumberVerificationCode") {
|
|
||||||
send_request(td_api::make_object<td_api::resendPhoneNumberVerificationCode>());
|
|
||||||
} else if (op == "seavc" || op == "SendEmailAddressVerificationCode") {
|
} else if (op == "seavc" || op == "SendEmailAddressVerificationCode") {
|
||||||
send_request(td_api::make_object<td_api::sendEmailAddressVerificationCode>(args));
|
send_request(td_api::make_object<td_api::sendEmailAddressVerificationCode>(args));
|
||||||
} else if (op == "ceavc" || op == "CheckEmailAddressVerificationCode") {
|
} else if (op == "ceavc" || op == "CheckEmailAddressVerificationCode") {
|
||||||
@ -2589,15 +2583,6 @@ class CliClient final : public Actor {
|
|||||||
send_request(td_api::make_object<td_api::resendRecoveryEmailAddressCode>());
|
send_request(td_api::make_object<td_api::resendRecoveryEmailAddressCode>());
|
||||||
} else if (op == "creav") {
|
} else if (op == "creav") {
|
||||||
send_request(td_api::make_object<td_api::cancelRecoveryEmailAddressVerification>());
|
send_request(td_api::make_object<td_api::cancelRecoveryEmailAddressVerification>());
|
||||||
} else if (op == "spncc") {
|
|
||||||
string hash;
|
|
||||||
string phone_number;
|
|
||||||
get_args(args, hash, phone_number);
|
|
||||||
send_request(td_api::make_object<td_api::sendPhoneNumberConfirmationCode>(hash, phone_number, nullptr));
|
|
||||||
} else if (op == "cpncc") {
|
|
||||||
send_request(td_api::make_object<td_api::checkPhoneNumberConfirmationCode>(args));
|
|
||||||
} else if (op == "rpncc") {
|
|
||||||
send_request(td_api::make_object<td_api::resendPhoneNumberConfirmationCode>());
|
|
||||||
} else {
|
} else {
|
||||||
op_not_found_count++;
|
op_not_found_count++;
|
||||||
}
|
}
|
||||||
@ -2729,12 +2714,22 @@ class CliClient final : public Actor {
|
|||||||
PrivacyRules rules;
|
PrivacyRules rules;
|
||||||
get_args(args, setting, rules);
|
get_args(args, setting, rules);
|
||||||
send_request(td_api::make_object<td_api::setUserPrivacySettingRules>(as_user_privacy_setting(setting), rules));
|
send_request(td_api::make_object<td_api::setUserPrivacySettingRules>(as_user_privacy_setting(setting), rules));
|
||||||
} else if (op == "cp" || op == "ChangePhone") {
|
} else if (op == "spncc") {
|
||||||
send_request(td_api::make_object<td_api::changePhoneNumber>(args, nullptr));
|
send_request(td_api::make_object<td_api::sendPhoneNumberCode>(
|
||||||
} else if (op == "ccpc" || op == "CheckChangePhoneCode") {
|
args, nullptr, td_api::make_object<td_api::phoneNumberCodeTypeChange>()));
|
||||||
send_request(td_api::make_object<td_api::checkChangePhoneNumberCode>(args));
|
} else if (op == "spncv") {
|
||||||
} else if (op == "rcpc" || op == "ResendChangePhoneCode") {
|
send_request(td_api::make_object<td_api::sendPhoneNumberCode>(
|
||||||
send_request(td_api::make_object<td_api::resendChangePhoneNumberCode>());
|
args, nullptr, td_api::make_object<td_api::phoneNumberCodeTypeVerify>()));
|
||||||
|
} else if (op == "spncco") {
|
||||||
|
string hash;
|
||||||
|
string phone_number;
|
||||||
|
get_args(args, hash, phone_number);
|
||||||
|
send_request(td_api::make_object<td_api::sendPhoneNumberCode>(
|
||||||
|
phone_number, nullptr, td_api::make_object<td_api::phoneNumberCodeTypeConfirmOwnership>(hash)));
|
||||||
|
} else if (op == "rpnc") {
|
||||||
|
send_request(td_api::make_object<td_api::resendPhoneNumberCode>());
|
||||||
|
} else if (op == "cpnc") {
|
||||||
|
send_request(td_api::make_object<td_api::checkPhoneNumberCode>(args));
|
||||||
} else if (op == "gco") {
|
} else if (op == "gco") {
|
||||||
if (args.empty()) {
|
if (args.empty()) {
|
||||||
send_request(td_api::make_object<td_api::getContacts>());
|
send_request(td_api::make_object<td_api::getContacts>());
|
||||||
|
Loading…
Reference in New Issue
Block a user