Replace empty first_name with phone_number.
GitOrigin-RevId: 3d19463a84d1aa074446382ff61e54f3f23563e1
This commit is contained in:
parent
b5f695de80
commit
57a6071c0f
@ -2446,6 +2446,9 @@ void ContactsManager::User::parse(ParserT &parser) {
|
|||||||
if (has_language_code) {
|
if (has_language_code) {
|
||||||
parse(language_code, parser);
|
parse(language_code, parser);
|
||||||
}
|
}
|
||||||
|
if (first_name.empty()) {
|
||||||
|
first_name = phone_number;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class StorerT>
|
template <class StorerT>
|
||||||
@ -6335,6 +6338,9 @@ void ContactsManager::on_update_user_name(UserId user_id, string &&first_name, s
|
|||||||
|
|
||||||
void ContactsManager::on_update_user_name(User *u, UserId user_id, string &&first_name, string &&last_name,
|
void ContactsManager::on_update_user_name(User *u, UserId user_id, string &&first_name, string &&last_name,
|
||||||
string &&username) {
|
string &&username) {
|
||||||
|
if (first_name.empty()) {
|
||||||
|
first_name = u->phone_number;
|
||||||
|
}
|
||||||
if (u->first_name != first_name || u->last_name != last_name) {
|
if (u->first_name != first_name || u->last_name != last_name) {
|
||||||
u->first_name = std::move(first_name);
|
u->first_name = std::move(first_name);
|
||||||
u->last_name = std::move(last_name);
|
u->last_name = std::move(last_name);
|
||||||
|
Reference in New Issue
Block a user