aboutsummaryrefslogtreecommitdiffhomepage
path: root/td/telegram/cli.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'td/telegram/cli.cpp')
-rw-r--r--td/telegram/cli.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/td/telegram/cli.cpp b/td/telegram/cli.cpp
index 3966fcbf1..785b8e135 100644
--- a/td/telegram/cli.cpp
+++ b/td/telegram/cli.cpp
@@ -264,10 +264,14 @@ class CliClient final : public Actor {
User &new_user = *new_user_ptr;
new_user.first_name = user.first_name_;
new_user.last_name = user.last_name_;
+ new_user.username = string();
if (user.usernames_ != nullptr) {
for (auto &username : user.usernames_->active_usernames_) {
username_to_user_id_[to_lower(username)] = user.id_;
}
+ if (!user.usernames_->active_usernames_.empty()) {
+ new_user.username = user.usernames_->active_usernames_[0];
+ }
}
}