aboutsummaryrefslogtreecommitdiffhomepage
path: root/td/telegram/Photo.cpp
diff options
context:
space:
mode:
authorlevlam <levlam@telegram.org>2022-12-23 18:27:38 +0300
committerlevlam <levlam@telegram.org>2022-12-23 18:27:38 +0300
commitb0446523eb32a8a774f28f411f3e88724ae73eb3 (patch)
treef15e00d73558e16b6deac69d3fde3e07c8e0d3f4 /td/telegram/Photo.cpp
parent3342dcef234a7a0cb8454eb3820de518d1bc5d5d (diff)
Support sending of media with spoiler.
Diffstat (limited to 'td/telegram/Photo.cpp')
-rw-r--r--td/telegram/Photo.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/td/telegram/Photo.cpp b/td/telegram/Photo.cpp
index 80a97a844..a064d0ff0 100644
--- a/td/telegram/Photo.cpp
+++ b/td/telegram/Photo.cpp
@@ -440,6 +440,9 @@ tl_object_ptr<telegram_api::InputMedia> photo_get_input_media(FileManager *file_
if (ttl != 0) {
flags |= telegram_api::inputMediaPhoto::TTL_SECONDS_MASK;
}
+ if (has_spoiler) {
+ flags |= telegram_api::inputMediaPhoto::SPOILER_MASK;
+ }
return make_tl_object<telegram_api::inputMediaPhoto>(flags, false /*ignored*/,
file_view.main_remote_location().as_input_photo(), ttl);
}
@@ -448,6 +451,9 @@ tl_object_ptr<telegram_api::InputMedia> photo_get_input_media(FileManager *file_
if (ttl != 0) {
flags |= telegram_api::inputMediaPhotoExternal::TTL_SECONDS_MASK;
}
+ if (has_spoiler) {
+ flags |= telegram_api::inputMediaPhotoExternal::SPOILER_MASK;
+ }
LOG(INFO) << "Create inputMediaPhotoExternal with a URL " << file_view.url() << " and TTL " << ttl;
return make_tl_object<telegram_api::inputMediaPhotoExternal>(flags, false /*ignored*/, file_view.url(), ttl);
}