diff --git a/td/telegram/CallActor.cpp b/td/telegram/CallActor.cpp index 2d3ad12a3..d997899fe 100644 --- a/td/telegram/CallActor.cpp +++ b/td/telegram/CallActor.cpp @@ -563,6 +563,9 @@ void CallActor::flush_call_state() { return; } call_state_need_flush_ = false; + + // can't call const function + // send_closure(G()->contacts_manager(), &ContactsManager::get_user_id_object, user_id_); send_closure(G()->td(), &Td::send_update, make_tl_object( make_tl_object(local_call_id_.get(), is_outgoing_ ? user_id_.get() : call_admin_id_, diff --git a/td/telegram/ContactsManager.cpp b/td/telegram/ContactsManager.cpp index eeb6ea10b..da7875dd9 100644 --- a/td/telegram/ContactsManager.cpp +++ b/td/telegram/ContactsManager.cpp @@ -3242,6 +3242,10 @@ void ContactsManager::on_load_imported_contacts_from_database(string value) { void ContactsManager::on_load_imported_contacts_finished() { LOG(INFO) << "Finished to load " << all_imported_contacts_.size() << " imported contacts"; + for (const auto &contact : all_imported_contacts_) { + get_user_id_object(contact.get_user_id()); // to ensure updateUser + } + are_imported_contacts_loaded_ = true; auto promises = std::move(load_imported_contacts_queries_); load_imported_contacts_queries_.clear(); @@ -4324,6 +4328,7 @@ void ContactsManager::on_imported_contacts(int64 random_id, vector impor std::unordered_map unique_id_to_unimported_contact_invites; for (size_t i = 0; i < add_size; i++) { auto unique_id = imported_contacts_pos_[i]; + get_user_id_object(imported_contact_user_ids[i]); // to ensure updateUser all_imported_contacts_[unique_id].set_user_id(imported_contact_user_ids[i]); unique_id_to_unimported_contact_invites[unique_id] = unimported_contact_invites[i]; } diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index c4f9d2f63..6ffcae990 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -20275,6 +20275,9 @@ unique_ptr MessagesManager::get_message_content(FormattedText me } case telegram_api::messageMediaContact::ID: { auto message_contact = move_tl_object_as(media); + if (message_contact->user_id_ != 0) { + td_->contacts_manager_->get_user_id_object(UserId(message_contact->user_id_)); // to ensure updateUser + } return make_unique(Contact(message_contact->phone_number_, message_contact->first_name_, message_contact->last_name_, message_contact->user_id_)); }