Add StoryManager::have_story.

This commit is contained in:
levlam 2023-06-06 15:58:27 +03:00
parent 114c92f365
commit f4a2dbde41
2 changed files with 6 additions and 0 deletions

View File

@ -540,6 +540,10 @@ void StoryManager::on_get_dialog_expiring_stories(DialogId owner_dialog_id,
})));
}
bool StoryManager::have_story(StoryFullId story_full_id) const {
return get_story(story_full_id) != nullptr;
}
td_api::object_ptr<td_api::story> StoryManager::get_story_object(StoryFullId story_full_id) const {
return get_story_object(story_full_id, get_story(story_full_id));
}

View File

@ -106,6 +106,8 @@ class StoryManager final : public Actor {
std::pair<int32, vector<StoryId>> on_get_stories(DialogId owner_dialog_id,
telegram_api::object_ptr<telegram_api::stories_stories> &&stories);
bool have_story(StoryFullId story_full_id) const;
td_api::object_ptr<td_api::story> get_story_object(StoryFullId story_full_id) const;
td_api::object_ptr<td_api::stories> get_stories_object(int32 total_count,