Invalidate and reload UserFull after receiving first incoming message from the user to fix chatActionBar.
GitOrigin-RevId: 34c0492433475fc49f01159615462e7b7edf7d0b
This commit is contained in:
parent
4117e54a3c
commit
09036ad929
@ -7091,6 +7091,16 @@ void ContactsManager::on_update_phone_number_privacy() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ContactsManager::invalidate_user_full(UserId user_id) {
|
||||||
|
auto user_full = get_user_full_force(user_id);
|
||||||
|
if (user_full != nullptr && !user_full->is_expired()) {
|
||||||
|
user_full->expires_at = 0.0;
|
||||||
|
user_full->need_save_to_database = true;
|
||||||
|
|
||||||
|
update_user_full(user_full, user_id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
UserId ContactsManager::get_user_id(const tl_object_ptr<telegram_api::User> &user) {
|
UserId ContactsManager::get_user_id(const tl_object_ptr<telegram_api::User> &user) {
|
||||||
CHECK(user != nullptr);
|
CHECK(user != nullptr);
|
||||||
switch (user->get_id()) {
|
switch (user->get_id()) {
|
||||||
|
@ -261,6 +261,8 @@ class ContactsManager : public Actor {
|
|||||||
|
|
||||||
void on_update_phone_number_privacy();
|
void on_update_phone_number_privacy();
|
||||||
|
|
||||||
|
void invalidate_user_full(UserId user_id);
|
||||||
|
|
||||||
void on_channel_unban_timeout(ChannelId channel_id);
|
void on_channel_unban_timeout(ChannelId channel_id);
|
||||||
|
|
||||||
void check_dialog_username(DialogId dialog_id, const string &username, Promise<CheckDialogUsernameResult> &&promise);
|
void check_dialog_username(DialogId dialog_id, const string &username, Promise<CheckDialogUsernameResult> &&promise);
|
||||||
|
@ -29038,6 +29038,30 @@ MessagesManager::Message *MessagesManager::add_message_to_dialog(Dialog *d, uniq
|
|||||||
update_top_dialogs(dialog_id, m);
|
update_top_dialogs(dialog_id, m);
|
||||||
cancel_user_dialog_action(dialog_id, m);
|
cancel_user_dialog_action(dialog_id, m);
|
||||||
try_hide_distance(dialog_id, m);
|
try_hide_distance(dialog_id, m);
|
||||||
|
|
||||||
|
if (d->messages == nullptr && !m->is_outgoing && dialog_id != get_my_dialog_id()) {
|
||||||
|
switch (dialog_id.get_type()) {
|
||||||
|
case DialogType::User:
|
||||||
|
td_->contacts_manager_->invalidate_user_full(dialog_id.get_user_id());
|
||||||
|
td_->contacts_manager_->reload_user_full(dialog_id.get_user_id());
|
||||||
|
break;
|
||||||
|
case DialogType::Chat:
|
||||||
|
case DialogType::Channel:
|
||||||
|
// nothing to do
|
||||||
|
break;
|
||||||
|
case DialogType::SecretChat: {
|
||||||
|
auto user_id = td_->contacts_manager_->get_secret_chat_user_id(dialog_id.get_secret_chat_id());
|
||||||
|
if (user_id.is_valid()) {
|
||||||
|
td_->contacts_manager_->invalidate_user_full(user_id);
|
||||||
|
td_->contacts_manager_->reload_user_full(user_id);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case DialogType::None:
|
||||||
|
default:
|
||||||
|
UNREACHABLE();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Message *result_message = treap_insert_message(&d->messages, std::move(message));
|
Message *result_message = treap_insert_message(&d->messages, std::move(message));
|
||||||
|
Loading…
Reference in New Issue
Block a user