Call on_dialog_bots_updated after speculative changes.

This commit is contained in:
levlam 2021-07-22 04:19:56 +03:00
parent cf579c761a
commit 2b8c23fdac

View File

@ -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<Unit>(), "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<Unit>(), "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);
}
}
}