2026-09-10 19:12:31 +00:00
|
|
|
// Module ID: 8188
|
|
|
|
|
// Function ID: 8189
|
2026-09-10 05:38:07 +00:00
|
|
|
// Name: ExplicitMediaUtils
|
2026-09-10 19:12:31 +00:00
|
|
|
// Dependencies: [1074, 1384, 7344, 7349, 4818, 1114, 2]
|
2026-07-20 16:05:17 +00:00
|
|
|
// Exports: getAttachmentObscurityDefaults, getAttachmentObscurityProps, getUnfurledMediaItemObscurityProps
|
|
|
|
|
|
2026-09-10 19:12:31 +00:00
|
|
|
// Module 8188 (ExplicitMediaUtils)
|
2026-09-10 05:38:07 +00:00
|
|
|
import Constants from "Constants" /* 1074 */;
|
|
|
|
|
import FlagUtils from "FlagUtils" /* 1384 */;
|
2026-09-10 19:12:31 +00:00
|
|
|
import ObscuredMediaUtils from "ObscuredMediaUtils" /* 7344 */;
|
|
|
|
|
import ExplicitMediaRedactionModels from "ExplicitMediaRedactionModels" /* 7349 */;
|
2026-09-10 05:38:07 +00:00
|
|
|
import size from "module_2" /* 2 */;
|
2026-07-23 10:11:24 +00:00
|
|
|
|
2026-09-10 05:38:07 +00:00
|
|
|
const MessageAttachmentFlags = Constants.MessageAttachmentFlags;
|
|
|
|
|
const result = size.fileFinishedImporting("modules/messages/native/renderer/ExplicitMediaUtils.tsx");
|
2026-07-20 16:05:17 +00:00
|
|
|
|
|
|
|
|
export const getAttachmentObscurityProps = function getAttachmentObscurityProps(shouldAgeVerify) {
|
|
|
|
|
({ attachment, shouldObscureSpoiler, enabledContentHarmTypeFlags } = shouldAgeVerify);
|
2026-07-29 08:29:29 +00:00
|
|
|
let num = attachment.flags;
|
|
|
|
|
if (num == null) {
|
|
|
|
|
num = 0;
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
2026-09-10 05:38:07 +00:00
|
|
|
const hasFlagResult = FlagUtils.hasFlag(num, MessageAttachmentFlags.IS_SPOILER);
|
2026-07-29 08:29:29 +00:00
|
|
|
if (undefined !== attachment.content_scan_version) {
|
|
|
|
|
let num2 = attachment.content_scan_version;
|
|
|
|
|
} else if (undefined !== attachment.contentScanVersion) {
|
|
|
|
|
num2 = attachment.contentScanVersion;
|
|
|
|
|
}
|
|
|
|
|
if (num2 == null) {
|
|
|
|
|
num2 = 0;
|
|
|
|
|
}
|
2026-09-10 05:38:07 +00:00
|
|
|
const obj2 = { contentScanVersion: num2, flags: null };
|
2026-07-29 08:29:29 +00:00
|
|
|
let num3 = attachment.flags;
|
|
|
|
|
if (num3 == null) {
|
|
|
|
|
num3 = 0;
|
|
|
|
|
}
|
2026-09-10 05:38:07 +00:00
|
|
|
obj2.flags = num3;
|
|
|
|
|
const tmpResult = ObscuredMediaUtils;
|
|
|
|
|
const mediaObscuredReasonFromBitmask = tmpResult.getMediaObscuredReasonFromBitmask({ type: ExplicitMediaRedactionModels.ObscuredMediaTypes.Attachment, media: obj2 }, enabledContentHarmTypeFlags);
|
|
|
|
|
const obj3 = { type: ExplicitMediaRedactionModels.ObscuredMediaTypes.Attachment, media: obj2 };
|
|
|
|
|
const tmpResult3 = ObscuredMediaUtils;
|
2026-07-29 08:29:29 +00:00
|
|
|
let isVerifiedTeenResult = tmp5;
|
2026-09-10 05:38:07 +00:00
|
|
|
const obj4 = { type: ExplicitMediaRedactionModels.ObscuredMediaTypes.Attachment, media: obj2 };
|
2026-07-20 16:05:17 +00:00
|
|
|
if (mediaObscuredReasonFromBitmask.length > 0) {
|
2026-09-10 19:12:31 +00:00
|
|
|
isVerifiedTeenResult = tmp(4818).isVerifiedTeen();
|
|
|
|
|
const tmpResult4 = tmp(4818);
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
2026-07-29 08:29:29 +00:00
|
|
|
let tmp7 = shouldObscureSpoiler;
|
2026-07-20 16:05:17 +00:00
|
|
|
if (shouldObscureSpoiler) {
|
2026-07-29 08:29:29 +00:00
|
|
|
tmp7 = hasFlagResult;
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
2026-09-10 05:38:07 +00:00
|
|
|
const obj5 = { isSpoiler: tmp7, spoiler: null, obscure: null, obscureDescription: null, obscureAwaitingScan: null, verifyAge: null, obscureHideControls: null, obscureIsOpaque: null };
|
2026-07-20 16:05:17 +00:00
|
|
|
let str = "";
|
|
|
|
|
let str2 = "";
|
|
|
|
|
if (shouldObscureSpoiler) {
|
|
|
|
|
str2 = str;
|
|
|
|
|
if (hasFlagResult) {
|
2026-09-05 10:56:28 +00:00
|
|
|
const intl = tmp(1114).intl;
|
|
|
|
|
str2 = intl.string(tmp(1114).t["F+x38C"]).toUpperCase();
|
|
|
|
|
const str3 = intl.string(tmp(1114).t["F+x38C"]);
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
}
|
2026-09-10 05:38:07 +00:00
|
|
|
obj5.spoiler = str2;
|
|
|
|
|
obj5.obscure = mediaObscuredReasonFromBitmask.length > 0;
|
2026-07-20 16:05:17 +00:00
|
|
|
if (mediaObscuredReasonFromBitmask.length > 0) {
|
2026-09-05 10:56:28 +00:00
|
|
|
const intl2 = tmp(1114).intl;
|
|
|
|
|
str = intl2.string(tmp(1114).t.SpxcUR);
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
2026-09-10 05:38:07 +00:00
|
|
|
obj5.obscureDescription = str;
|
|
|
|
|
obj5.obscureAwaitingScan = tmpResult3.isMediaScanPending({ type: ExplicitMediaRedactionModels.ObscuredMediaTypes.Attachment, media: obj2 }, enabledContentHarmTypeFlags);
|
2026-07-29 08:29:29 +00:00
|
|
|
shouldAgeVerify = tmp5;
|
2026-07-20 16:05:17 +00:00
|
|
|
if (mediaObscuredReasonFromBitmask.length > 0) {
|
|
|
|
|
shouldAgeVerify = shouldAgeVerify.shouldAgeVerify;
|
|
|
|
|
}
|
2026-09-10 05:38:07 +00:00
|
|
|
obj5.verifyAge = shouldAgeVerify;
|
|
|
|
|
obj5.obscureHideControls = isVerifiedTeenResult;
|
|
|
|
|
obj5.obscureIsOpaque = mediaObscuredReasonFromBitmask.length > 0;
|
|
|
|
|
return obj5;
|
2026-07-20 16:05:17 +00:00
|
|
|
};
|
|
|
|
|
export const getUnfurledMediaItemObscurityProps = function getUnfurledMediaItemObscurityProps(arg0) {
|
2026-07-29 08:29:29 +00:00
|
|
|
({ type, mediaItem, isSpoilered, isAuthorBot, enabledContentHarmTypeFlags } = arg0);
|
|
|
|
|
({ shouldObscureSpoiler, shouldAgeVerify } = arg0);
|
2026-09-10 05:38:07 +00:00
|
|
|
const obj = ObscuredMediaUtils;
|
2026-07-20 16:05:17 +00:00
|
|
|
let isMediaScanPendingResult = !isAuthorBot;
|
2026-09-10 05:38:07 +00:00
|
|
|
const mediaObscuredReasonFromBitmask = obj.getMediaObscuredReasonFromBitmask({ type: ExplicitMediaRedactionModels.ObscuredMediaTypes.GenericMedia, media: mediaItem }, enabledContentHarmTypeFlags);
|
2026-07-29 08:29:29 +00:00
|
|
|
if (!isAuthorBot) {
|
2026-09-10 19:12:31 +00:00
|
|
|
const obj3 = { type: tmp(7349).ObscuredMediaTypes.GenericMedia, media: mediaItem };
|
|
|
|
|
isMediaScanPendingResult = tmp(7344).isMediaScanPending(obj3, enabledContentHarmTypeFlags);
|
|
|
|
|
const tmpResult = tmp(7344);
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
if (isSpoilered) {
|
|
|
|
|
isSpoilered = shouldObscureSpoiler;
|
|
|
|
|
}
|
|
|
|
|
let isVerifiedTeenResult = tmp4;
|
|
|
|
|
if (mediaObscuredReasonFromBitmask.length > 0) {
|
2026-09-10 19:12:31 +00:00
|
|
|
isVerifiedTeenResult = tmp(4818).isVerifiedTeen();
|
|
|
|
|
const tmpResult2 = tmp(4818);
|
2026-07-29 08:29:29 +00:00
|
|
|
}
|
2026-09-10 05:38:07 +00:00
|
|
|
const obj4 = { isSpoiler: isSpoilered, spoilerDescription: null, isObscured: null, obscureDescription: null, obscureAwaitingScan: null, verifyAge: null, obscureHideControls: null, obscureIsOpaque: null };
|
2026-07-29 08:29:29 +00:00
|
|
|
if (!isSpoilered) {
|
2026-09-10 05:38:07 +00:00
|
|
|
obj4.spoilerDescription = null;
|
|
|
|
|
obj4.isObscured = tmp4;
|
2026-07-29 08:29:29 +00:00
|
|
|
let stringResult = null;
|
|
|
|
|
if (tmp4) {
|
2026-09-05 10:56:28 +00:00
|
|
|
const intl4 = tmp(1114).intl;
|
|
|
|
|
stringResult = intl4.string(tmp(1114).t.SpxcUR);
|
2026-07-29 08:29:29 +00:00
|
|
|
}
|
2026-09-10 05:38:07 +00:00
|
|
|
obj4.obscureDescription = stringResult;
|
|
|
|
|
obj4.obscureAwaitingScan = isMediaScanPendingResult;
|
2026-07-29 08:29:29 +00:00
|
|
|
let tmp9 = tmp4;
|
|
|
|
|
if (tmp4) {
|
|
|
|
|
tmp9 = shouldAgeVerify;
|
|
|
|
|
}
|
2026-09-10 05:38:07 +00:00
|
|
|
obj4.verifyAge = tmp9;
|
|
|
|
|
obj4.obscureHideControls = isVerifiedTeenResult;
|
|
|
|
|
obj4.obscureIsOpaque = tmp4;
|
|
|
|
|
return obj4;
|
2026-07-29 08:29:29 +00:00
|
|
|
} else if ("image" === type) {
|
2026-09-05 10:56:28 +00:00
|
|
|
const intl3 = tmp(1114).intl;
|
|
|
|
|
let stringResult1 = intl3.string(tmp(1114).t.sb2W2J);
|
2026-07-29 08:29:29 +00:00
|
|
|
} else {
|
|
|
|
|
if ("video" === type) {
|
2026-09-05 10:56:28 +00:00
|
|
|
const intl2 = tmp(1114).intl;
|
|
|
|
|
stringResult1 = intl2.string(tmp(1114).t.ehBaMc);
|
2026-07-29 08:29:29 +00:00
|
|
|
} else if ("file" !== type) {
|
|
|
|
|
if ("generic" === type) {
|
2026-09-05 10:56:28 +00:00
|
|
|
const intl5 = tmp(1114).intl;
|
|
|
|
|
stringResult1 = intl5.string(tmp(1114).t.G71b77);
|
2026-07-29 08:29:29 +00:00
|
|
|
}
|
|
|
|
|
}
|
2026-09-05 10:56:28 +00:00
|
|
|
const intl = tmp(1114).intl;
|
|
|
|
|
stringResult1 = intl.string(tmp(1114).t["3Gc2XP"]);
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
export function getAttachmentObscurityDefaults() {
|
2026-07-23 10:11:24 +00:00
|
|
|
return { isSpoiler: false, spoiler: "" };
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|