decord/source/modules/forwarding/getInlineForwardOptions.tsx
github-actions 777dc50a28 chore: update source for alpha 346.3
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4790.js (118.4 MB)
2026-09-10 19:12:31 +00:00

62 lines
1.9 KiB
TypeScript

// Module ID: 12002
// Function ID: 12003
// Name: getInlineForwardOptions
// Dependencies: [1074, 4755, 2]
// Exports: getInlineForwardOptions
// Module 12002 (getInlineForwardOptions)
import Constants from "Constants" /* 1074 */;
import MediaFormatTesters from "MediaFormatTesters" /* 4755 */;
import size from "module_2" /* 2 */;
const MessageReferenceTypes = Constants.MessageReferenceTypes;
const result = size.fileFinishedImporting("modules/forwarding/getInlineForwardOptions.tsx");
export const getInlineForwardOptions = function getInlineForwardOptions(message, nativeSyntheticEventData) {
({ targetKind, embedIndex } = nativeSyntheticEventData);
if ("media" === targetKind) {
const messageReference = message.messageReference;
let type;
if (messageReference != null) {
type = messageReference.type;
}
let tmp6 = message;
if (type === MessageReferenceTypes.FORWARD) {
const first = message.messageSnapshots[0];
message = undefined;
if (first != null) {
message = first.message;
}
tmp6 = message;
}
let mapped;
if (tmp6 != null) {
const attachments = tmp6.attachments;
const found = attachments.filter((filename) => {
filename = filename.filename;
let isImageFileResult = MediaFormatTesters.isImageFile(filename);
if (!isImageFileResult) {
isImageFileResult = MediaFormatTesters.isVideoFile(filename);
const tmpResult = MediaFormatTesters;
}
return isImageFileResult;
});
mapped = found.map((id) => id.id);
}
const obj2 = { onlyAttachmentIds: mapped };
return obj2;
} else {
if ("embed" === targetKind) {
if (null != embedIndex) {
const obj3 = { onlyEmbedIndices: null };
const items = [embedIndex];
obj3.onlyEmbedIndices = items;
let obj = obj3;
}
return obj;
}
if ("shortcut" === targetKind) {
obj = {};
}
}
};