Add StoryManager::send_update_story.

This commit is contained in:
levlam 2023-07-12 16:16:55 +03:00
parent b9473decc2
commit a4e4a20fb4
2 changed files with 9 additions and 4 deletions

View File

@ -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<td_api::updateStory>(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<td_api::updateStory>(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<td_api::updateStory>(get_story_object(story_full_id, story)));
}
td_api::object_ptr<td_api::updateChatActiveStories> StoryManager::get_update_chat_active_stories(
DialogId owner_dialog_id) const {
return td_api::make_object<td_api::updateChatActiveStories>(get_chat_active_stories_object(owner_dialog_id));

View File

@ -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<td_api::updateChatActiveStories> get_update_chat_active_stories(DialogId owner_dialog_id) const;
void send_update_chat_active_stories(DialogId owner_dialog_id);