Really fix Verify and Confirm for phone number.

GitOrigin-RevId: 1f859c039bdf5a554efa4d328848fafa36c659d4
This commit is contained in:
levlam 2019-09-02 18:11:47 +03:00
parent 0d2df39a2e
commit ebf9f45eeb
3 changed files with 10 additions and 9 deletions

View File

@ -56,7 +56,7 @@ void PhoneNumberManager::set_phone_number(uint64 query_id, string phone_number,
case Type::ChangePhone: case Type::ChangePhone:
return process_send_code_result(query_id, send_code_helper_.send_change_phone_code(phone_number, settings)); return process_send_code_result(query_id, send_code_helper_.send_change_phone_code(phone_number, settings));
case Type::VerifyPhone: case Type::VerifyPhone:
return process_send_code_result(query_id, send_code_helper_.send_confirm_phone_code(phone_number, settings)); return process_send_code_result(query_id, send_code_helper_.send_verify_phone_code(phone_number, settings));
case Type::ConfirmPhone: case Type::ConfirmPhone:
default: default:
UNREACHABLE(); UNREACHABLE();
@ -74,7 +74,8 @@ void PhoneNumberManager::set_phone_number_and_hash(uint64 query_id, string hash,
switch (type_) { switch (type_) {
case Type::ConfirmPhone: case Type::ConfirmPhone:
return process_send_code_result(query_id, send_code_helper_.send_verify_phone_code(hash, phone_number, settings)); return process_send_code_result(query_id,
send_code_helper_.send_confirm_phone_code(hash, phone_number, settings));
case Type::ChangePhone: case Type::ChangePhone:
case Type::VerifyPhone: case Type::VerifyPhone:
default: default:

View File

@ -71,17 +71,17 @@ Result<telegram_api::account_sendChangePhoneCode> SendCodeHelper::send_change_ph
return telegram_api::account_sendChangePhoneCode(phone_number_, get_input_code_settings(settings)); return telegram_api::account_sendChangePhoneCode(phone_number_, get_input_code_settings(settings));
} }
Result<telegram_api::account_sendVerifyPhoneCode> SendCodeHelper::send_verify_phone_code(const string &hash, Result<telegram_api::account_sendVerifyPhoneCode> SendCodeHelper::send_verify_phone_code(Slice phone_number,
const Settings &settings) {
phone_number_ = phone_number.str();
return telegram_api::account_sendVerifyPhoneCode(phone_number_, get_input_code_settings(settings));
}
Result<telegram_api::account_sendConfirmPhoneCode> SendCodeHelper::send_confirm_phone_code(const string &hash,
Slice phone_number, Slice phone_number,
const Settings &settings) { const Settings &settings) {
phone_number_ = phone_number.str(); phone_number_ = phone_number.str();
return telegram_api::account_sendVerifyPhoneCode(hash, get_input_code_settings(settings)); return telegram_api::account_sendConfirmPhoneCode(hash, get_input_code_settings(settings));
}
Result<telegram_api::account_sendConfirmPhoneCode> SendCodeHelper::send_confirm_phone_code(Slice phone_number,
const Settings &settings) {
phone_number_ = phone_number.str();
return telegram_api::account_sendConfirmPhoneCode(phone_number_, get_input_code_settings(settings));
} }
SendCodeHelper::AuthenticationCodeInfo SendCodeHelper::get_authentication_code_info( SendCodeHelper::AuthenticationCodeInfo SendCodeHelper::get_authentication_code_info(

View File

@ -31,10 +31,10 @@ class SendCodeHelper {
Result<telegram_api::account_sendChangePhoneCode> send_change_phone_code(Slice phone_number, Result<telegram_api::account_sendChangePhoneCode> send_change_phone_code(Slice phone_number,
const Settings &settings); const Settings &settings);
Result<telegram_api::account_sendVerifyPhoneCode> send_verify_phone_code(const string &hash, Slice phone_number, Result<telegram_api::account_sendVerifyPhoneCode> send_verify_phone_code(Slice phone_number,
const Settings &settings); const Settings &settings);
Result<telegram_api::account_sendConfirmPhoneCode> send_confirm_phone_code(Slice phone_number, Result<telegram_api::account_sendConfirmPhoneCode> send_confirm_phone_code(const string &hash, Slice phone_number,
const Settings &settings); const Settings &settings);
Slice phone_number() const { Slice phone_number() const {