From 2b8c23fdac36bec6aea002cdc7eb0305fb270d2f Mon Sep 17 00:00:00 2001 From: levlam Date: Thu, 22 Jul 2021 04:19:56 +0300 Subject: [PATCH] Call on_dialog_bots_updated after speculative changes. --- td/telegram/ContactsManager.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/td/telegram/ContactsManager.cpp b/td/telegram/ContactsManager.cpp index 3f8a70988..bf7a8d2af 100644 --- a/td/telegram/ContactsManager.cpp +++ b/td/telegram/ContactsManager.cpp @@ -11875,6 +11875,9 @@ void ContactsManager::speculative_add_channel_participants(ChannelId channel_id, channel_full->bot_user_ids.push_back(user_id); channel_full->need_save_to_database = true; reload_channel_full(channel_id, Promise(), "speculative_add_channel_participants"); + + send_closure_later(G()->messages_manager(), &MessagesManager::on_dialog_bots_updated, DialogId(channel_id), + channel_full->bot_user_ids, false); } } if (is_participants_cache_changed) { @@ -11912,6 +11915,9 @@ void ContactsManager::speculative_delete_channel_participant(ChannelId channel_i if (channel_full != nullptr && td::remove(channel_full->bot_user_ids, deleted_user_id)) { channel_full->need_save_to_database = true; update_channel_full(channel_full, channel_id); + + send_closure_later(G()->messages_manager(), &MessagesManager::on_dialog_bots_updated, DialogId(channel_id), + channel_full->bot_user_ids, false); } } @@ -12049,10 +12055,16 @@ void ContactsManager::speculative_add_channel_user(ChannelId channel_id, UserId channel_full->bot_user_ids.push_back(user_id); channel_full->need_save_to_database = true; reload_channel_full(channel_id, Promise(), "speculative_add_channel_user"); + + send_closure_later(G()->messages_manager(), &MessagesManager::on_dialog_bots_updated, DialogId(channel_id), + channel_full->bot_user_ids, false); } } else { if (td::remove(channel_full->bot_user_ids, user_id)) { channel_full->need_save_to_database = true; + + send_closure_later(G()->messages_manager(), &MessagesManager::on_dialog_bots_updated, DialogId(channel_id), + channel_full->bot_user_ids, false); } } }