From a4e4a20fb4343aca20ec73147197f45f5e53d5d2 Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 12 Jul 2023 16:16:55 +0300 Subject: [PATCH] Add StoryManager::send_update_story. --- td/telegram/StoryManager.cpp | 11 +++++++---- td/telegram/StoryManager.h | 2 ++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/td/telegram/StoryManager.cpp b/td/telegram/StoryManager.cpp index 86d8401f4..3208858dd 100644 --- a/td/telegram/StoryManager.cpp +++ b/td/telegram/StoryManager.cpp @@ -964,8 +964,7 @@ void StoryManager::on_story_can_get_viewers_timeout(int64 story_global_id) { } if (story->content_ != nullptr && story->is_update_sent_) { // can_get_viewers flag has changed - send_closure(G()->td(), &Td::send_update, - td_api::make_object(get_story_object(story_full_id, story))); + send_update_story(story_full_id, story); } cached_story_viewers_.erase(story_full_id); } @@ -2378,8 +2377,7 @@ void StoryManager::on_story_changed(StoryFullId story_full_id, const Story *stor } if (is_changed && story->is_update_sent_) { - send_closure(G()->td(), &Td::send_update, - td_api::make_object(get_story_object(story_full_id, story))); + send_update_story(story_full_id, story); } send_closure_later(G()->messages_manager(), @@ -2654,6 +2652,11 @@ void StoryManager::delete_active_stories_from_story_list(DialogId owner_dialog_i CHECK(is_deleted); } +void StoryManager::send_update_story(StoryFullId story_full_id, const Story *story) { + send_closure(G()->td(), &Td::send_update, + td_api::make_object(get_story_object(story_full_id, story))); +} + td_api::object_ptr StoryManager::get_update_chat_active_stories( DialogId owner_dialog_id) const { return td_api::make_object(get_chat_active_stories_object(owner_dialog_id)); diff --git a/td/telegram/StoryManager.h b/td/telegram/StoryManager.h index 9b8302bd9..0284b3b8c 100644 --- a/td/telegram/StoryManager.h +++ b/td/telegram/StoryManager.h @@ -402,6 +402,8 @@ class StoryManager final : public Actor { void delete_active_stories_from_story_list(DialogId owner_dialog_id, const ActiveStories *active_stories); + void send_update_story(StoryFullId story_full_id, const Story *story); + td_api::object_ptr get_update_chat_active_stories(DialogId owner_dialog_id) const; void send_update_chat_active_stories(DialogId owner_dialog_id);