diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index bf291095..b952a7b9 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -2698,6 +2698,9 @@ updateChatNotificationSettings chat_id:int53 notification_settings:chatNotificat //@description Notification settings for some type of chats were updated @scope Types of chats for which notification settings were updated @notification_settings The new notification settings updateScopeNotificationSettings scope:NotificationSettingsScope notification_settings:scopeNotificationSettings = Update; +//@description The chat action bar was changed @chat_id Chat identifier @action_bar The new value of the action bar; may be null +updateChatActionBar chat_id:int53 action_bar:ChatActionBar = Update; + //@description The chat pinned message was changed @chat_id Chat identifier @pinned_message_id The new identifier of the pinned message; 0 if there is no pinned message in the chat updateChatPinnedMessage chat_id:int53 pinned_message_id:int53 = Update; diff --git a/td/generate/scheme/td_api.tlo b/td/generate/scheme/td_api.tlo index 680b47c4..d2bb1dd6 100644 Binary files a/td/generate/scheme/td_api.tlo and b/td/generate/scheme/td_api.tlo differ diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index 3b646b56..b5459fdd 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -6662,7 +6662,7 @@ void MessagesManager::on_get_peer_settings(DialogId dialog_id, fix_dialog_action_bar(d); - on_dialog_updated(dialog_id, "on_get_peer_settings"); + send_update_chat_action_bar(d); } void MessagesManager::fix_dialog_action_bar(Dialog *d) { @@ -21233,6 +21233,14 @@ void MessagesManager::send_update_chat_chat_list(const Dialog *d) const { make_tl_object(d->dialog_id.get(), get_chat_list_object(d))); } +void MessagesManager::send_update_chat_action_bar(const Dialog *d) { + CHECK(d != nullptr); + LOG_CHECK(d->is_update_new_chat_sent) << "Wrong " << d->dialog_id << " in send_update_chat_action_bar"; + on_dialog_updated(d->dialog_id, "send_update_chat_action_bar"); + send_closure(G()->td(), &Td::send_update, + td_api::make_object(d->dialog_id.get(), get_chat_action_bar_object(d))); +} + void MessagesManager::on_send_message_get_quick_ack(int64 random_id) { auto it = being_sent_messages_.find(random_id); if (it == being_sent_messages_.end()) { @@ -22169,13 +22177,13 @@ void MessagesManager::on_dialog_is_blocked_updated(DialogId dialog_id, bool is_b d->can_share_phone_number = false; d->can_block_user = false; d->can_add_contact = false; - // TODO send_update_chat_action_bar(d); - on_dialog_updated(dialog_id, "on_dialog_is_blocked_updated 1"); + send_update_chat_action_bar(d); } } else { d->know_action_bar = false; // TODO repair_dialog_action_bar(d); - on_dialog_updated(dialog_id, "on_dialog_is_blocked_updated 2"); + // there is no need to change action bar + on_dialog_updated(dialog_id, "on_dialog_is_blocked_updated"); } } } diff --git a/td/telegram/MessagesManager.h b/td/telegram/MessagesManager.h index f9c9e578..5c05528f 100644 --- a/td/telegram/MessagesManager.h +++ b/td/telegram/MessagesManager.h @@ -1804,6 +1804,8 @@ class MessagesManager : public Actor { void send_update_chat_chat_list(const Dialog *d) const; + void send_update_chat_action_bar(const Dialog *d); + tl_object_ptr get_message_object(DialogId dialog_id, const Message *m, bool for_event_log = false) const;