Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4791.js (118.4 MB)
62 lines
1.9 KiB
TypeScript
62 lines
1.9 KiB
TypeScript
// Module ID: 12025
|
|
// Function ID: 12026
|
|
// Name: getInlineForwardOptions
|
|
// Dependencies: [1074, 4756, 2]
|
|
// Exports: getInlineForwardOptions
|
|
|
|
// Module 12025 (getInlineForwardOptions)
|
|
import Constants from "Constants" /* 1074 */;
|
|
import MediaFormatTesters from "MediaFormatTesters" /* 4756 */;
|
|
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 = {};
|
|
}
|
|
}
|
|
};
|