decord/source/modules/forwarding/getInlineForwardOptions.tsx

62 lines
1.8 KiB
TypeScript
Raw Normal View History

2026-08-28 06:19:39 +00:00
// Module ID: 11442
// Function ID: 11443
2026-07-20 16:05:17 +00:00
// Name: getInlineForwardOptions
2026-08-28 06:19:39 +00:00
// Dependencies: [676, 4637, 2]
2026-07-20 16:05:17 +00:00
// Exports: getInlineForwardOptions
2026-08-28 06:19:39 +00:00
// Module 11442 (getInlineForwardOptions)
2026-08-24 06:08:38 +00:00
import set from "set" /* 2 */;
import ME from "ME" /* 676 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
const MessageReferenceTypes = ME.MessageReferenceTypes;
const result = set.fileFinishedImporting("modules/forwarding/getInlineForwardOptions.tsx");
2026-07-20 16:05:17 +00:00
export const getInlineForwardOptions = function getInlineForwardOptions(message, nativeSyntheticEventData) {
({ targetKind, embedIndex } = nativeSyntheticEventData);
if ("media" === targetKind) {
const messageReference = message.messageReference;
let type;
2026-07-29 08:29:29 +00:00
if (messageReference != null) {
2026-07-20 16:05:17 +00:00
type = messageReference.type;
}
2026-07-29 08:29:29 +00:00
let tmp6 = message;
2026-07-20 16:05:17 +00:00
if (type === MessageReferenceTypes.FORWARD) {
const first = message.messageSnapshots[0];
message = undefined;
2026-07-29 08:29:29 +00:00
if (first != null) {
2026-07-20 16:05:17 +00:00
message = first.message;
}
2026-07-29 08:29:29 +00:00
tmp6 = message;
2026-07-20 16:05:17 +00:00
}
let mapped;
2026-07-29 08:29:29 +00:00
if (tmp6 != null) {
const attachments = tmp6.attachments;
2026-07-20 16:05:17 +00:00
const found = attachments.filter((filename) => {
filename = filename.filename;
2026-07-29 08:29:29 +00:00
let isImageFileResult = callback(table[1]).isImageFile(filename);
2026-07-20 16:05:17 +00:00
if (!isImageFileResult) {
2026-07-29 08:29:29 +00:00
isImageFileResult = callback(table[1]).isVideoFile(filename);
const tmpResult = callback(table[1]);
2026-07-20 16:05:17 +00:00
}
return isImageFileResult;
});
mapped = found.map((id) => id.id);
}
2026-07-29 08:29:29 +00:00
let obj = { onlyAttachmentIds: null };
obj[0] = mapped;
2026-07-20 16:05:17 +00:00
return obj;
} else {
if ("embed" === targetKind) {
if (null != embedIndex) {
2026-07-29 08:29:29 +00:00
obj = { onlyEmbedIndices: null };
2026-07-20 16:05:17 +00:00
const items = [embedIndex];
2026-07-29 08:29:29 +00:00
obj[0] = items;
2026-07-20 16:05:17 +00:00
}
return obj;
}
if ("shortcut" === targetKind) {
obj = {};
}
}
};