diff options
| author | levlam <levlam@telegram.org> | 2022-12-20 18:06:21 +0300 |
|---|---|---|
| committer | levlam <levlam@telegram.org> | 2022-12-20 18:06:21 +0300 |
| commit | 94e678dbc89065eb5cc37aa17ff9bc55c33e575a (patch) | |
| tree | 68be4f891ec5d475a5c165747ff62591365b459a /td/telegram/Photo.cpp | |
| parent | f99fb4fc06c4f150e7d22f13e3cf9032aa00a53b (diff) | |
Add has_spoiler flag to messagePhoto and messageVideo.
Diffstat (limited to 'td/telegram/Photo.cpp')
| -rw-r--r-- | td/telegram/Photo.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/td/telegram/Photo.cpp b/td/telegram/Photo.cpp index 467429e0c..feacf6cdf 100644 --- a/td/telegram/Photo.cpp +++ b/td/telegram/Photo.cpp @@ -417,7 +417,7 @@ bool photo_has_input_media(FileManager *file_manager, const Photo &photo, bool i tl_object_ptr<telegram_api::InputMedia> photo_get_input_media(FileManager *file_manager, const Photo &photo, tl_object_ptr<telegram_api::InputFile> input_file, - int32 ttl) { + int32 ttl, bool has_spoiler) { if (!photo.photos.empty()) { auto file_id = photo.photos.back().file_id; auto file_view = file_manager->get_file_view(file_id); @@ -456,10 +456,7 @@ tl_object_ptr<telegram_api::InputMedia> photo_get_input_media(FileManager *file_ } CHECK(!photo.photos.empty()); - auto file_id = photo.photos.back().file_id; - auto file_view = file_manager->get_file_view(file_id); - auto file_type = file_view.get_type(); - if (file_type == FileType::PhotoWithSpoiler) { + if (has_spoiler) { flags |= telegram_api::inputMediaUploadedPhoto::SPOILER_MASK; } |
