From bf3f1c33ae58d8120688185648d72693f2d320cd Mon Sep 17 00:00:00 2001 From: levlam Date: Fri, 7 Jul 2023 16:18:18 +0300 Subject: [PATCH] Return updateChatActiveStories in getCurrentState. --- td/telegram/StoryManager.cpp | 8 ++++++++ td/telegram/StoryManager.h | 2 ++ td/telegram/Td.cpp | 2 ++ 3 files changed, 12 insertions(+) diff --git a/td/telegram/StoryManager.cpp b/td/telegram/StoryManager.cpp index 8cbfd9a63..090854428 100644 --- a/td/telegram/StoryManager.cpp +++ b/td/telegram/StoryManager.cpp @@ -3087,6 +3087,14 @@ void StoryManager::remove_story_notifications_by_story_ids(DialogId dialog_id, c } } +void StoryManager::get_current_state(vector> &updates) const { + if (!td_->auth_manager_->is_bot()) { + active_stories_.foreach([&](const DialogId &dialog_id, const unique_ptr &) { + updates.push_back(get_update_chat_active_stories(dialog_id)); + }); + } +} + void StoryManager::on_binlog_events(vector &&events) { if (G()->close_flag()) { return; diff --git a/td/telegram/StoryManager.h b/td/telegram/StoryManager.h index 518d25750..bb5893746 100644 --- a/td/telegram/StoryManager.h +++ b/td/telegram/StoryManager.h @@ -225,6 +225,8 @@ class StoryManager final : public Actor { void try_synchronize_archive_all_stories(); + void get_current_state(vector> &updates) const; + void on_binlog_events(vector &&events); private: diff --git a/td/telegram/Td.cpp b/td/telegram/Td.cpp index 7649bbb63..157b96d62 100644 --- a/td/telegram/Td.cpp +++ b/td/telegram/Td.cpp @@ -4319,6 +4319,8 @@ void Td::on_request(uint64 id, const td_api::getCurrentState &request) { notification_manager_->get_current_state(updates); + story_manager_->get_current_state(updates); + config_manager_.get_actor_unsafe()->get_current_state(updates); autosave_manager_->get_current_state(updates);