From 8b0be018b8a58141b48b775a2653f2090aa49593 Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 4 Dec 2019 21:01:00 +0300 Subject: [PATCH] Add send_update_chat_has_scheduled_messages function. GitOrigin-RevId: 40f93886362b53651c0eb5eb77b3847bc127bd83 --- td/telegram/MessagesManager.cpp | 12 ++++++++---- td/telegram/MessagesManager.h | 2 ++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index 544fe24d4..814a0b79b 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -22080,6 +22080,13 @@ void MessagesManager::send_update_chat_action_bar(const Dialog *d) { td_api::make_object(d->dialog_id.get(), get_chat_action_bar_object(d))); } +void MessagesManager::send_update_chat_has_scheduled_messages(const Dialog *d) const { + LOG_CHECK(d->is_update_new_chat_sent) << "Wrong " << d->dialog_id << " in send_update_chat_has_scheduled_messages"; + send_closure(G()->td(), &Td::send_update, + td_api::make_object( + d->dialog_id.get(), d->has_scheduled_server_messages || d->scheduled_messages != nullptr)); +} + 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()) { @@ -22925,11 +22932,8 @@ void MessagesManager::set_dialog_has_scheduled_server_messages(Dialog *d, bool h on_dialog_updated(d->dialog_id, "set_dialog_has_scheduled_server_messages"); LOG(INFO) << "Set " << d->dialog_id << " has_scheduled_server_messages to " << has_scheduled_server_messages; - LOG_CHECK(d->is_update_new_chat_sent) << "Wrong " << d->dialog_id << " in set_dialog_has_scheduled_server_messages"; if (d->scheduled_messages == nullptr) { - send_closure( - G()->td(), &Td::send_update, - td_api::make_object(d->dialog_id.get(), has_scheduled_server_messages)); + send_update_chat_has_scheduled_messages(d); } } diff --git a/td/telegram/MessagesManager.h b/td/telegram/MessagesManager.h index 244ac50a3..45410d724 100644 --- a/td/telegram/MessagesManager.h +++ b/td/telegram/MessagesManager.h @@ -1869,6 +1869,8 @@ class MessagesManager : public Actor { void send_update_chat_action_bar(const Dialog *d); + void send_update_chat_has_scheduled_messages(const Dialog *d) const; + void hide_dialog_action_bar(Dialog *d); static Result get_message_schedule_date(td_api::object_ptr &&scheduling_state);