Hide all business bot manage bars when changing business bot.

This commit is contained in:
levlam 2024-04-08 02:45:54 +03:00
parent 7aad37608f
commit 69fd5333d7
3 changed files with 13 additions and 0 deletions

View File

@ -102,6 +102,7 @@ class UpdateConnectedBotQuery final : public Td::ResultHandler {
auto ptr = result_ptr.move_as_ok(); auto ptr = result_ptr.move_as_ok();
LOG(INFO) << "Receive result for UpdateConnectedBotQuery: " << to_string(ptr); LOG(INFO) << "Receive result for UpdateConnectedBotQuery: " << to_string(ptr);
td_->messages_manager_->hide_all_business_bot_manager_bars();
td_->updates_manager_->on_get_updates(std::move(ptr), std::move(promise_)); td_->updates_manager_->on_get_updates(std::move(ptr), std::move(promise_));
} }

View File

@ -7859,6 +7859,16 @@ void MessagesManager::remove_dialog_action_bar(DialogId dialog_id, Promise<Unit>
toggle_dialog_report_spam_state_on_server(dialog_id, false, 0, std::move(promise)); toggle_dialog_report_spam_state_on_server(dialog_id, false, 0, std::move(promise));
} }
void MessagesManager::hide_all_business_bot_manager_bars() {
dialogs_.foreach([&](const DialogId &dialog_id, unique_ptr<Dialog> &dialog) {
Dialog *d = dialog.get();
if (d->business_bot_manage_bar != nullptr) {
d->business_bot_manage_bar = nullptr;
send_update_chat_business_bot_manage_bar(d);
}
});
}
void MessagesManager::repair_dialog_active_group_call_id(DialogId dialog_id) { void MessagesManager::repair_dialog_active_group_call_id(DialogId dialog_id) {
if (td_->dialog_manager_->have_input_peer(dialog_id, AccessRights::Read)) { if (td_->dialog_manager_->have_input_peer(dialog_id, AccessRights::Read)) {
LOG(INFO) << "Repair active voice chat ID in " << dialog_id; LOG(INFO) << "Repair active voice chat ID in " << dialog_id;

View File

@ -850,6 +850,8 @@ class MessagesManager final : public Actor {
void reget_dialog_action_bar(DialogId dialog_id, const char *source, bool is_repair = true); void reget_dialog_action_bar(DialogId dialog_id, const char *source, bool is_repair = true);
void hide_all_business_bot_manager_bars();
void on_get_peer_settings(DialogId dialog_id, tl_object_ptr<telegram_api::peerSettings> &&peer_settings, void on_get_peer_settings(DialogId dialog_id, tl_object_ptr<telegram_api::peerSettings> &&peer_settings,
bool ignore_privacy_exception = false); bool ignore_privacy_exception = false);