aboutsummaryrefslogtreecommitdiffhomepage
path: root/td/telegram/StoryContent.cpp
diff options
context:
space:
mode:
authorlevlam <levlam@telegram.org>2023-05-25 14:19:54 +0300
committerlevlam <levlam@telegram.org>2023-05-25 14:19:54 +0300
commitb27b9caa89c3c87b0a46acf93d31bceaf5613f1a (patch)
treec0f27567d7a4680d90e85d7d7f2bd907aee3ab39 /td/telegram/StoryContent.cpp
parentb88312dda1fa4e8ef9635a089dbe7c9e8568c33b (diff)
Add FileType::VideoStory.
Diffstat (limited to 'td/telegram/StoryContent.cpp')
-rw-r--r--td/telegram/StoryContent.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/td/telegram/StoryContent.cpp b/td/telegram/StoryContent.cpp
index db9503194..c7331bd1e 100644
--- a/td/telegram/StoryContent.cpp
+++ b/td/telegram/StoryContent.cpp
@@ -96,7 +96,8 @@ unique_ptr<StoryContent> get_story_content(Td *td, tl_object_ptr<telegram_api::M
}
CHECK(document_id == telegram_api::document::ID);
auto parsed_document = td->documents_manager_->on_get_document(
- move_tl_object_as<telegram_api::document>(document_ptr), owner_dialog_id, nullptr);
+ move_tl_object_as<telegram_api::document>(document_ptr), owner_dialog_id, nullptr, Document::Type::Video,
+ DocumentsManager::Subtype::Story);
if (parsed_document.empty() || parsed_document.type != Document::Type::Video) {
LOG(ERROR) << "Receive a story with " << parsed_document;
break;
@@ -112,7 +113,8 @@ unique_ptr<StoryContent> get_story_content(Td *td, tl_object_ptr<telegram_api::M
} else {
CHECK(alt_document_id == telegram_api::document::ID);
auto parsed_alt_document = td->documents_manager_->on_get_document(
- move_tl_object_as<telegram_api::document>(alt_document_ptr), owner_dialog_id, nullptr);
+ move_tl_object_as<telegram_api::document>(alt_document_ptr), owner_dialog_id, nullptr,
+ Document::Type::Video, DocumentsManager::Subtype::Story);
if (parsed_alt_document.empty() || parsed_alt_document.type != Document::Type::Video) {
LOG(ERROR) << "Receive alternative " << to_string(alt_document_ptr);
} else {
@@ -152,6 +154,8 @@ Result<unique_ptr<StoryContent>> get_input_story_content(
auto input_story = static_cast<const td_api::inputStoryContentVideo *>(input_story_content.get());
TRY_RESULT(file_id, td->file_manager_->get_input_file_id(FileType::Video, input_story->video_, owner_dialog_id,
false, false));
+ file_id =
+ td->file_manager_->copy_file_id(file_id, FileType::VideoStory, owner_dialog_id, "get_input_story_content");
auto sticker_file_ids =
td->stickers_manager_->get_attached_sticker_file_ids(input_story->added_sticker_file_ids_);
bool has_stickers = !sticker_file_ids.empty();