MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / SendExistingDocument

Function SendExistingDocument

Telegram/SourceFiles/api/api_sending.cpp:301–326  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

299} // namespace
300
301void 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
328void SendExistingPhoto(
329 MessageToSend &&message,

Callers 8

forwardMessagesMethod · 0.85
sendExistingDocumentMethod · 0.85
sendExistingDocumentMethod · 0.85
sendExistingDocumentMethod · 0.85
showContextMenuMethod · 0.85
sendExistingDocumentMethod · 0.85
AddRepeaterActionFunction · 0.85
sendExistingDocumentMethod · 0.85

Calls 9

MTP_flagsFunction · 0.85
SendExistingMediaFunction · 0.85
stickerOrGifOriginMethod · 0.80
incrementStickerMethod · 0.80
FlagsClass · 0.50
mtpInputMethod · 0.45
stickerMethod · 0.45
stickersMethod · 0.45
ownerMethod · 0.45

Tested by

no test coverage detected