| 299 | } // namespace |
| 300 | |
| 301 | void SendExistingDocument( |
| 302 | MessageToSend &&message, |
| 303 | not_null<DocumentData*> document, |
| 304 | std::optional<MsgId> localMessageId) { |
| 305 | const auto inputMedia = [=] { |
| 306 | return MTP_inputMediaDocument( |
| 307 | MTP_flags(message.action.options.mediaSpoiler |
| 308 | ? MTPDinputMediaDocument::Flag::f_spoiler |
| 309 | : MTPDinputMediaDocument::Flags(0)), |
| 310 | document->mtpInput(), |
| 311 | MTPInputPhoto(), // video_cover |
| 312 | MTPint(), // ttl_seconds |
| 313 | MTPint(), // video_timestamp |
| 314 | MTPstring()); // query |
| 315 | }; |
| 316 | SendExistingMedia( |
| 317 | std::move(message), |
| 318 | document, |
| 319 | inputMedia, |
| 320 | document->stickerOrGifOrigin(), |
| 321 | std::move(localMessageId)); |
| 322 | |
| 323 | if (document->sticker()) { |
| 324 | document->owner().stickers().incrementSticker(document); |
| 325 | } |
| 326 | } |
| 327 | |
| 328 | void SendExistingPhoto( |
| 329 | MessageToSend &&message, |
no test coverage detected