Add get_story_content_any_file_id.

This commit is contained in:
levlam 2023-05-24 17:24:36 +03:00
parent 41da14fd17
commit 2b74fb9542
2 changed files with 14 additions and 0 deletions

View File

@ -229,6 +229,18 @@ td_api::object_ptr<td_api::StoryContent> get_story_content_object(Td *td, const
}
}
FileId get_story_content_any_file_id(const Td *td, const StoryContent *content) {
switch (content->get_type()) {
case StoryContentType::Photo:
return get_photo_any_file_id(static_cast<const StoryContentPhoto *>(content)->photo_);
case StoryContentType::Video:
return static_cast<const StoryContentVideo *>(content)->file_id_;
case StoryContentType::Unsupported:
default:
return {};
}
}
vector<FileId> get_story_content_file_ids(const Td *td, const StoryContent *content) {
switch (content->get_type()) {
case StoryContentType::Photo:

View File

@ -42,6 +42,8 @@ void merge_story_contents(Td *td, const StoryContent *old_content, StoryContent
td_api::object_ptr<td_api::StoryContent> get_story_content_object(Td *td, const StoryContent *content);
FileId get_story_content_any_file_id(const Td *td, const StoryContent *content);
vector<FileId> get_story_content_file_ids(const Td *td, const StoryContent *content);
int32 get_story_content_duration(const Td *td, const StoryContent *content);