From dbc2e30effb8effb8be670c62d722caed4a0588b Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 6 Jan 2020 20:44:21 +0300 Subject: [PATCH] Do not send updateChatActionBar about nonexistent secret chats. GitOrigin-RevId: 64fe7ef6e66612428fa6b65ed68e89c3de9eab4c --- td/telegram/MessagesManager.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index f6caff60..63bc8e47 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -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( - d->dialog_id.get_user_id(), [this, d](SecretChatId secret_chat_id) { - send_closure(G()->td(), &Td::send_update, - td_api::make_object(DialogId(secret_chat_id).get(), - get_chat_action_bar_object(d))); + d->dialog_id.get_user_id(), [this, user_d = d](SecretChatId secret_chat_id) { + DialogId dialog_id(secret_chat_id); + auto secret_chat_d = get_dialog(dialog_id); // must not create the dialog + if (secret_chat_d != nullptr && secret_chat_d->is_update_new_chat_sent) { + send_closure( + G()->td(), &Td::send_update, + td_api::make_object(dialog_id.get(), get_chat_action_bar_object(user_d))); + } }); }