Do not send updateChatActionBar about nonexistent secret chats.

GitOrigin-RevId: 64fe7ef6e66612428fa6b65ed68e89c3de9eab4c
This commit is contained in:
levlam 2020-01-06 20:44:21 +03:00
parent 2dea8aea06
commit dbc2e30eff

View File

@ -22740,10 +22740,14 @@ void MessagesManager::send_update_secret_chats_with_user_action_bar(const Dialog
} }
td_->contacts_manager_->for_each_secret_chat_with_user( td_->contacts_manager_->for_each_secret_chat_with_user(
d->dialog_id.get_user_id(), [this, d](SecretChatId secret_chat_id) { d->dialog_id.get_user_id(), [this, user_d = d](SecretChatId secret_chat_id) {
send_closure(G()->td(), &Td::send_update, DialogId dialog_id(secret_chat_id);
td_api::make_object<td_api::updateChatActionBar>(DialogId(secret_chat_id).get(), auto secret_chat_d = get_dialog(dialog_id); // must not create the dialog
get_chat_action_bar_object(d))); if (secret_chat_d != nullptr && secret_chat_d->is_update_new_chat_sent) {
send_closure(
G()->td(), &Td::send_update,
td_api::make_object<td_api::updateChatActionBar>(dialog_id.get(), get_chat_action_bar_object(user_d)));
}
}); });
} }