Improve checkChatUsernameResultUsernamePurchasable detection.
This commit is contained in:
parent
2e5bab9c48
commit
19e15f283c
@ -6210,6 +6210,9 @@ void ContactsManager::check_dialog_username(DialogId dialog_id, const string &us
|
||||
return promise.set_value(CheckDialogUsernameResult::Invalid);
|
||||
}
|
||||
if (error.message() == "USERNAME_PURCHASE_AVAILABLE") {
|
||||
if (begins_with(G()->get_option_string("my_phone_number"), "1")) {
|
||||
return promise.set_value(CheckDialogUsernameResult::Invalid);
|
||||
}
|
||||
return promise.set_value(CheckDialogUsernameResult::Purchasable);
|
||||
}
|
||||
return promise.set_error(std::move(error));
|
||||
|
Loading…
Reference in New Issue
Block a user