428 lines
26 KiB
TypeScript
428 lines
26 KiB
TypeScript
/* Metro module 4821; source: modules/explicit_media_redaction/ExplicitMediaRedactionUtils.tsx; dependencies: [4649, 1379, 4822, 4824, 661, 1314, 1244, 683, 4825, 4826, 4831, 4832, 3835, 4861, 4813, 4840, 2] */
|
|
function _fun42038(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#42038, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4999:6, offset: 0x0112e8b9, size: 609 bytes, params: 8, frame: 20
|
|
const env0_0 = require;
|
|
const timeoutAttachmentsAndEmbedsForMessage = function(a0) {
|
|
var object = {};
|
|
object.attachments = a0.attachments.map(_fun42040);
|
|
object.embeds = a0.embeds.map(_fun42041);
|
|
return object;
|
|
};
|
|
const closure = useShouldAgeVerifyForExplicitMedia;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const devSettingsStore = importDefault(4649) /* metro dependency 4649: DevSettingsStore */;
|
|
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
|
|
const explicitMediaStore = importDefault(4822) /* metro dependency 4822: ExplicitMediaStore */;
|
|
const explicitMediaRedactionConstantsModule = require(4824) /* metro dependency 4824: ExplicitMediaRedactionConstants */;
|
|
const env0_6 = explicitMediaRedactionConstantsModule.EXPLICIT_MEDIA_MIN_HEIGHT;
|
|
const env0_7 = explicitMediaRedactionConstantsModule.EXPLICIT_MEDIA_MIN_WIDTH;
|
|
const env0_8 = (require(661) /* metro dependency 661: Constants */).AnalyticEvents;
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/explicit_media_redaction/ExplicitMediaRedactionUtils.tsx');
|
|
exports.redactionSettingToRenderedString = redactionSettingToRenderedString;
|
|
exports.isPendingScanVersion = isPendingScanVersion;
|
|
exports.TrackMediaRedactionActionType = {EXPLICIT_MEDIA_LEARN_MORE_VIEWED: 'explicit_media_learn_more_viewed',
|
|
EXPLICIT_MEDIA_LEARN_MORE_CLICK_SETTINGS: 'explicit_media_learn_more_click_settings',
|
|
EXPLICIT_MEDIA_LEARN_MORE_CLICK_LEARN_MORE: 'explicit_media_learn_more_click_learn_more',
|
|
EXPLICIT_MEDIA_LEARN_MORE_CLICK_DISMISS: 'explicit_media_learn_more_click_dismiss',
|
|
EXPLICIT_MEDIA_LEARN_MORE_CLICK_FALSE_POSITIVE: 'explicit_media_learn_more_click_false_positive',
|
|
EXPLICIT_MEDIA_LEARN_MORE_CLICK_AGE_VERIFY_REVERIFY: 'explicit_media_learn_more_click_age_verify_reverify',
|
|
EXPLICIT_MEDIA_LEARN_MORE_CLICK_AGE_VERIFY_LEARN_MORE: 'explicit_media_learn_more_click_age_verify_learn_more',
|
|
EXPLICIT_MEDIA_FALSE_POSITIVE_VIEWED: 'explicit_media_false_positive_viewed',
|
|
EXPLICIT_MEDIA_FALSE_POSITIVE_CLICK_CONFIRM: 'explicit_media_false_positive_click_confirm',
|
|
EXPLICIT_MEDIA_FALSE_POSITIVE_CLICK_CANCEL: 'explicit_media_false_positive_click_cancel',
|
|
EXPLICIT_MEDIA_SENDER_FALSE_POSITIVE_BUTTON_CLICKED: 'explicit_media_sender_false_positive_button_clicked',
|
|
EXPLICIT_MEDIA_FALSE_POSITIVE_CLYDE_MESSAGE_SENT: 'explicit_media_false_positive_clyde_message_sent'};
|
|
exports.TrackMediaRedactionContext = {EXPLICIT_MEDIA_OBSCURED_FALSE_POSITIVE_FLOW: 'explicit_media_obscured_false_positive_flow',
|
|
EXPLICIT_MEDIA_SENDER_FALSE_POSITIVE_FLOW: 'explicit_media_sender_false_positive_flow',
|
|
EXPLICIT_MEDIA_MESSAGE_SEND_BLOCKED: 'explicit_media_message_send_blocked',
|
|
EXPLICIT_MEDIA_ADD_MEDIA_TO_FORUM_POST_BLOCKED: 'explicit_media_add_media_to_forum_post_blocked'};
|
|
exports.trackMediaRedactionAction = trackMediaRedactionAction;
|
|
exports.TimeoutCancelSource = {UPDATE: 'update', TIMEOUT: 'timeout'};
|
|
exports.trackScanTiming = trackScanTiming;
|
|
exports.trackScanningTimedOut = trackScanningTimedOut;
|
|
exports.trackExplicitMediaRedactableMessagedLoaded = trackExplicitMediaRedactableMessagedLoaded;
|
|
exports.trackRedactableMessageLoaded = trackRedactableMessageLoaded;
|
|
exports.trackExplicitMediaScanComplete = trackExplicitMediaScanComplete;
|
|
exports.handleExplicitMediaScanTimeoutForMessage = handleExplicitMediaScanTimeoutForMessage;
|
|
exports.isObscuredMediaBelowConstraints = function(a0, a1) {
|
|
return a0 != null && a1 != null && (a0 <= EXPLICIT_MEDIA_MIN_WIDTH || a1 <= EXPLICIT_MEDIA_MIN_HEIGHT);
|
|
};
|
|
exports.shouldAgeVerifyForExplicitMedia = shouldAgeVerifyForExplicitMedia;
|
|
exports.useShouldAgeVerifyForExplicitMedia = closure;
|
|
exports.useShouldAgeVerifyForReason = useShouldAgeVerifyForReason;
|
|
exports.trackToggleMediaObscurityV2 = trackToggleMediaObscurityV2;
|
|
exports.hasMessageSnapshotsWithAttachmentsOrEmbeds = function({message_snapshots}) {
|
|
return message_snapshots?.some(_fun42062);
|
|
};
|
|
}
|
|
|
|
function timeoutAttachmentsAndEmbedsForMessage({attachments, embeds}) { // fn#42039, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4999:1822, offset: 0x0112eb1a, size: 61 bytes, params: 2, frame: 14
|
|
const object2 = {};
|
|
object2.attachments = attachments.map(function(a0) {
|
|
a0.content_scan_version = -1;
|
|
return a0;
|
|
});
|
|
object2.embeds = embeds.map(function(a0) {
|
|
a0.contentScanVersion = -1;
|
|
return a0;
|
|
});
|
|
return object2;
|
|
}
|
|
|
|
function useShouldAgeVerifyForExplicitMedia() { // fn#42042, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4999:2000, offset: 0x0112eb79, size: 90 bytes, params: 1, frame: 14
|
|
var value;
|
|
const useIsFeatureAgeGated = (require(3835) /* metro dependency 3835: RegionalFeatureConfigUtils */).useIsFeatureAgeGated;
|
|
const AgeGatedFeature = (require(4861) /* metro dependency 4861: AgeGatedFeature */).AgeGatedFeature;
|
|
const SENSITIVE_CONTENT_SHOW_SETTING = AgeGatedFeature.SENSITIVE_CONTENT_SHOW_SETTING;
|
|
value = Reflect.apply(useIsFeatureAgeGated, value, [SENSITIVE_CONTENT_SHOW_SETTING]);
|
|
return value && (require(4813) /* metro dependency 4813: AgeVerificationUtils */).useShouldShowTiggerPawtect();
|
|
}
|
|
|
|
function redactionSettingToRenderedString(a0) { // fn#42043, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4999:2325, offset: 0x0112ebd3, size: 135 bytes, params: 2, frame: 15
|
|
const ExplicitContentRedaction = (require(1314) /* metro dependency 1314: preloaded_user_settings */).ExplicitContentRedaction;
|
|
const SHOW = ExplicitContentRedaction.SHOW;
|
|
if (SHOW === a0) {
|
|
return function() {
|
|
return require(dependencyMap[6]).intl.string(require(dependencyMap[6]).t['5k5OFp']);
|
|
};
|
|
}
|
|
const BLUR = ExplicitContentRedaction.BLUR;
|
|
if (BLUR === a0) {
|
|
return function() {
|
|
return require(dependencyMap[6]).intl.string(require(dependencyMap[6]).t.S49Uad);
|
|
};
|
|
}
|
|
const BLOCK = ExplicitContentRedaction.BLOCK;
|
|
if (BLOCK === a0) {
|
|
return function() {
|
|
return require(dependencyMap[6]).intl.string(require(dependencyMap[6]).t['D/157Y']);
|
|
};
|
|
}
|
|
}
|
|
|
|
function isPendingScanVersion(a0) { // fn#42047, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4999:2685, offset: 0x0112ed14, size: 85 bytes, params: 2, frame: 14
|
|
var r1;
|
|
var r0;
|
|
const value2 = DevSettingsStore.get('explicit_media_redaction_ignore_pending_scan');
|
|
if (value2) {
|
|
r0 = !value2;
|
|
} else {
|
|
r1 = a0 !== 0 && a0 !== -1;
|
|
r1 = r1 && (a0 == null || a0 !== ExplicitMediaStore.validContentScanVersion);
|
|
r0 = r1;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function trackMediaRedactionAction({action, channelId, messageId, context}) { // fn#42048, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4999:2932, offset: 0x0112ed69, size: 175 bytes, params: 2, frame: 21
|
|
var channel;
|
|
var value3;
|
|
var defaultImport;
|
|
var track;
|
|
var EXPLICIT_MEDIA_ACTION;
|
|
var object2;
|
|
if (channelId != null) {
|
|
if (messageId != null) {
|
|
channel = ChannelStore.getChannel(channelId);
|
|
value3 = undefined;
|
|
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
track = defaultImport.track;
|
|
EXPLICIT_MEDIA_ACTION = AnalyticEvents.EXPLICIT_MEDIA_ACTION;
|
|
object2 = {action: action};
|
|
object2.guild_id = channel == null ? value3 : channel.guild_id;
|
|
object2.channel_id = channelId;
|
|
object2.message_id = messageId;
|
|
object2.user_is_underage = (require(4825) /* metro dependency 4825: SelfModUtils */).isCurrentUserTeen();
|
|
object2.context = context;
|
|
Reflect.apply(track, defaultImport, [EXPLICIT_MEDIA_ACTION, object2]);
|
|
}
|
|
}
|
|
}
|
|
|
|
function trackScanTiming(a0, a1) { // fn#42049, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4999:3266, offset: 0x0112ee18, size: 217 bytes, params: 3, frame: 18
|
|
const Date = global.Date;
|
|
let value = Date.now();
|
|
value -= a0;
|
|
const Math = global.Math;
|
|
const min = Math.min;
|
|
const Math2 = global.Math;
|
|
value = Math2.floor(value / 1000);
|
|
value = Reflect.apply(min, Math, [value, 3]);
|
|
const defaultImport = importDefault(4826) /* metro dependency 4826: MonitoringAgent */;
|
|
const increment = defaultImport.increment;
|
|
const MetricEvents = (require(4831) /* metro dependency 4831: MetricEvents */).MetricEvents;
|
|
const EXPLICIT_MEDIA_SCAN_CLIENT_TIMING = MetricEvents.EXPLICIT_MEDIA_SCAN_CLIENT_TIMING;
|
|
value = 'timingBucket:' + value;
|
|
Reflect.apply(increment, defaultImport, [{name: EXPLICIT_MEDIA_SCAN_CLIENT_TIMING, tags: [value, 'source:' + a1,
|
|
'metricVersion:1']}]);
|
|
}
|
|
|
|
function trackScanningTimedOut({channelId, messageId, attachmentIds, embedIds}) { // fn#42050, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4999:3513, offset: 0x0112eef1, size: 447 bytes, params: 2, frame: 23
|
|
var length;
|
|
var r0;
|
|
var value;
|
|
var value2;
|
|
var channel;
|
|
var defaultImport;
|
|
var track;
|
|
var EXPLICIT_MEDIA_SCAN_CLIENT_TIMED_OUT;
|
|
var object2;
|
|
const MESSAGE_SCAN_TIMEOUT = (require(4832) /* metro dependency 4832: ExplicitMediaManager */).MESSAGE_SCAN_TIMEOUT;
|
|
var defaultImport2;
|
|
var increment;
|
|
const MetricEvents = (require(4831) /* metro dependency 4831: MetricEvents */).MetricEvents;
|
|
var defaultImport3;
|
|
var distribution;
|
|
if (channelId != null) {
|
|
if (messageId != null) {
|
|
value = undefined;
|
|
length = attachmentIds == null ? value : attachmentIds.length;
|
|
value2 = 0;
|
|
if (value2 !== (length ?? value2)) {
|
|
channel = ChannelStore.getChannel(channelId);
|
|
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
track = defaultImport.track;
|
|
EXPLICIT_MEDIA_SCAN_CLIENT_TIMED_OUT = AnalyticEvents.EXPLICIT_MEDIA_SCAN_CLIENT_TIMED_OUT;
|
|
object2 = {channel_id: channelId};
|
|
object2.guild_id = channel == null ? value : channel.guild_id;
|
|
object2.message_id = messageId;
|
|
object2.embed_ids = embedIds;
|
|
object2.user_is_underage = (require(4825) /* metro dependency 4825: SelfModUtils */).isCurrentUserTeen();
|
|
object2.scan_timeout_duration = MESSAGE_SCAN_TIMEOUT;
|
|
object2.attachment_ids_v2 = attachmentIds;
|
|
Reflect.apply(track, defaultImport, [EXPLICIT_MEDIA_SCAN_CLIENT_TIMED_OUT, object2]);
|
|
defaultImport2 = importDefault(4826) /* metro dependency 4826: MonitoringAgent */;
|
|
increment = defaultImport2.increment;
|
|
EXPLICIT_MEDIA_SCAN_CLIENT_TIMED_OUT = MetricEvents.EXPLICIT_MEDIA_SCAN_CLIENT_TIMED_OUT;
|
|
Reflect.apply(increment, defaultImport2, [{name: EXPLICIT_MEDIA_SCAN_CLIENT_TIMED_OUT,
|
|
tags: ['metricVersion:1']}]);
|
|
defaultImport3 = importDefault(4826) /* metro dependency 4826: MonitoringAgent */;
|
|
distribution = defaultImport3.distribution;
|
|
length = attachmentIds == null ? value : attachmentIds.length;
|
|
r0 = length ?? value2;
|
|
length = embedIds == null ? value : embedIds.length;
|
|
Reflect.apply(distribution, defaultImport3,
|
|
[{name: MetricEvents.EXPLICIT_MEDIA_SCAN_CLIENT_TIMED_OUT_DISTRIBUTION},
|
|
r0 + (length ?? value2)]);
|
|
} else {
|
|
length = embedIds == null ? value : embedIds.length;
|
|
if (value2 !== (length ?? value2)) {
|
|
channel = ChannelStore.getChannel(channelId);
|
|
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
track = defaultImport.track;
|
|
EXPLICIT_MEDIA_SCAN_CLIENT_TIMED_OUT = AnalyticEvents.EXPLICIT_MEDIA_SCAN_CLIENT_TIMED_OUT;
|
|
object2 = {channel_id: channelId};
|
|
object2.guild_id = channel == null ? value : channel.guild_id;
|
|
object2.message_id = messageId;
|
|
object2.embed_ids = embedIds;
|
|
object2.user_is_underage = (require(4825) /* metro dependency 4825: SelfModUtils */).isCurrentUserTeen();
|
|
object2.scan_timeout_duration = MESSAGE_SCAN_TIMEOUT;
|
|
object2.attachment_ids_v2 = attachmentIds;
|
|
Reflect.apply(track, defaultImport, [EXPLICIT_MEDIA_SCAN_CLIENT_TIMED_OUT, object2]);
|
|
defaultImport2 = importDefault(4826) /* metro dependency 4826: MonitoringAgent */;
|
|
increment = defaultImport2.increment;
|
|
EXPLICIT_MEDIA_SCAN_CLIENT_TIMED_OUT = MetricEvents.EXPLICIT_MEDIA_SCAN_CLIENT_TIMED_OUT;
|
|
Reflect.apply(increment, defaultImport2, [{name: EXPLICIT_MEDIA_SCAN_CLIENT_TIMED_OUT,
|
|
tags: ['metricVersion:1']}]);
|
|
defaultImport3 = importDefault(4826) /* metro dependency 4826: MonitoringAgent */;
|
|
distribution = defaultImport3.distribution;
|
|
length = attachmentIds == null ? value : attachmentIds.length;
|
|
r0 = length ?? value2;
|
|
length = embedIds == null ? value : embedIds.length;
|
|
Reflect.apply(distribution, defaultImport3,
|
|
[{name: MetricEvents.EXPLICIT_MEDIA_SCAN_CLIENT_TIMED_OUT_DISTRIBUTION},
|
|
r0 + (length ?? value2)]);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function trackExplicitMediaRedactableMessagedLoaded({channelId, numOfAttachments, numOfAttachmentsPendingScan, numOfEmbeds, numOfEmbedsPendingScan}) { // fn#42051, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4999:4329, offset: 0x0112f0b0, size: 229 bytes, params: 2, frame: 22
|
|
var channel;
|
|
var value3;
|
|
var defaultImport;
|
|
var track;
|
|
var EXPLICIT_MEDIA_REDACTABLE_MESSAGES_LOADED;
|
|
var object2;
|
|
var value4;
|
|
var defaultImport2;
|
|
var distribution;
|
|
if (channelId != null) {
|
|
channel = ChannelStore.getChannel(channelId);
|
|
value3 = undefined;
|
|
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
track = defaultImport.track;
|
|
EXPLICIT_MEDIA_REDACTABLE_MESSAGES_LOADED = AnalyticEvents.EXPLICIT_MEDIA_REDACTABLE_MESSAGES_LOADED;
|
|
object2 = {channel_id: channelId};
|
|
object2.guild_id = channel == null ? value3 : channel.guild_id;
|
|
object2.num_of_attachments = numOfAttachments;
|
|
object2.num_of_attachments_pending_scan = numOfAttachmentsPendingScan;
|
|
object2.num_of_embeds = numOfEmbeds;
|
|
object2.num_of_embeds_pending_scan = numOfEmbedsPendingScan;
|
|
Reflect.apply(track, defaultImport, [EXPLICIT_MEDIA_REDACTABLE_MESSAGES_LOADED, object2]);
|
|
value4 = numOfAttachmentsPendingScan + numOfEmbedsPendingScan;
|
|
if (value4 > 0) {
|
|
defaultImport2 = importDefault(4826) /* metro dependency 4826: MonitoringAgent */;
|
|
distribution = defaultImport2.distribution;
|
|
object2 = {};
|
|
object2.name = (require(4831) /* metro dependency 4831: MetricEvents */).MetricEvents.EXPLICIT_MEDIA_PENDING_MESSAGE_LOADED_V2;
|
|
Reflect.apply(distribution, defaultImport2, [object2, value4]);
|
|
}
|
|
}
|
|
}
|
|
|
|
function trackRedactableMessageLoaded({messageId, channelId, numOfAttachments, numOfSelfHarmAttachments, numOfEmbeds, numOfGoreAttachments, numOfExplicitAttachments, numOfSelfHarmEmbeds, numOfGoreEmbeds, numOfExplicitEmbeds}) { // fn#42052, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4999:4869, offset: 0x0112f195, size: 305 bytes, params: 2, frame: 29
|
|
var channel;
|
|
var value3;
|
|
var defaultImport;
|
|
const r6 = numOfExplicitAttachments > 0 || numOfExplicitEmbeds > 0;
|
|
const r5 = numOfGoreAttachments > 0 || numOfGoreEmbeds > 0;
|
|
const r4 = numOfSelfHarmAttachments > 0 || numOfSelfHarmEmbeds > 0;
|
|
if (channelId != null) {
|
|
if (messageId != null) {
|
|
if (r6) {
|
|
channel = ChannelStore.getChannel(channelId);
|
|
value3 = undefined;
|
|
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
defaultImport.track(AnalyticEvents.REDACTABLE_MESSAGE_LOADED, {message_id: messageId,
|
|
channel_id: channelId,
|
|
channel_type: channel == null ? value3 : channel.type,
|
|
guild_id: channel == null ? value3 : channel.guild_id,
|
|
num_of_attachments: numOfAttachments, num_of_gore_attachments: numOfGoreAttachments,
|
|
num_of_explicit_attachments: numOfExplicitAttachments,
|
|
num_of_self_harm_attachments: numOfSelfHarmAttachments,
|
|
num_of_embeds: numOfEmbeds, num_of_gore_embeds: numOfGoreEmbeds,
|
|
num_of_explicit_embeds: numOfExplicitEmbeds,
|
|
num_of_self_harm_embeds: numOfSelfHarmEmbeds, has_redactable_explicit: r6, has_redactable_gore: r5,
|
|
has_redactable_self_harm: r4});
|
|
} else if (r5) {
|
|
channel = ChannelStore.getChannel(channelId);
|
|
value3 = undefined;
|
|
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
defaultImport.track(AnalyticEvents.REDACTABLE_MESSAGE_LOADED, {message_id: messageId,
|
|
channel_id: channelId,
|
|
channel_type: channel == null ? value3 : channel.type,
|
|
guild_id: channel == null ? value3 : channel.guild_id,
|
|
num_of_attachments: numOfAttachments, num_of_gore_attachments: numOfGoreAttachments,
|
|
num_of_explicit_attachments: numOfExplicitAttachments,
|
|
num_of_self_harm_attachments: numOfSelfHarmAttachments,
|
|
num_of_embeds: numOfEmbeds, num_of_gore_embeds: numOfGoreEmbeds,
|
|
num_of_explicit_embeds: numOfExplicitEmbeds,
|
|
num_of_self_harm_embeds: numOfSelfHarmEmbeds, has_redactable_explicit: r6, has_redactable_gore: r5,
|
|
has_redactable_self_harm: r4});
|
|
} else if (r4) {
|
|
channel = ChannelStore.getChannel(channelId);
|
|
value3 = undefined;
|
|
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
defaultImport.track(AnalyticEvents.REDACTABLE_MESSAGE_LOADED, {message_id: messageId,
|
|
channel_id: channelId,
|
|
channel_type: channel == null ? value3 : channel.type,
|
|
guild_id: channel == null ? value3 : channel.guild_id,
|
|
num_of_attachments: numOfAttachments, num_of_gore_attachments: numOfGoreAttachments,
|
|
num_of_explicit_attachments: numOfExplicitAttachments,
|
|
num_of_self_harm_attachments: numOfSelfHarmAttachments,
|
|
num_of_embeds: numOfEmbeds, num_of_gore_embeds: numOfGoreEmbeds,
|
|
num_of_explicit_embeds: numOfExplicitEmbeds,
|
|
num_of_self_harm_embeds: numOfSelfHarmEmbeds, has_redactable_explicit: r6, has_redactable_gore: r5,
|
|
has_redactable_self_harm: r4});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function trackExplicitMediaScanComplete({messageId, channelId, numOfAttachments, numOfExplicitAttachments, numOfEmbeds, numOfExplicitEmbeds}) { // fn#42053, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4999:5644, offset: 0x0112f2c6, size: 178 bytes, params: 2, frame: 22
|
|
var channel;
|
|
var value3;
|
|
var defaultImport;
|
|
if (channelId != null) {
|
|
channel = ChannelStore.getChannel(channelId);
|
|
value3 = undefined;
|
|
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
defaultImport.track(AnalyticEvents.EXPLICIT_MEDIA_RETROACTIVE_SCAN_COMPLETE, {message_id: messageId,
|
|
channel_id: channelId, channel_type: channel == null ? value3 : channel.type,
|
|
guild_id: channel == null ? value3 : channel.guild_id, num_of_attachments: numOfAttachments,
|
|
num_of_explicit_attachments: numOfExplicitAttachments, num_of_embeds: numOfEmbeds,
|
|
num_of_explicit_embeds: numOfExplicitEmbeds});
|
|
}
|
|
}
|
|
|
|
function handleExplicitMediaScanTimeoutForMessage(a0) { // fn#42054, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4999:6120, offset: 0x0112f378, size: 71 bytes, params: 2, frame: 14
|
|
const value = timeoutAttachmentsAndEmbedsForMessage(a0);
|
|
return a0.merge({attachments: value.attachments, embeds: value.embeds, messageSnapshots: (({messageSnapshots}) => {
|
|
if (messageSnapshots == null) {
|
|
return messageSnapshots;
|
|
}
|
|
if (messageSnapshots.length === 0) {
|
|
return messageSnapshots;
|
|
}
|
|
return messageSnapshots.map(_fun42056);
|
|
})(a0)});
|
|
}
|
|
|
|
function shouldAgeVerifyForExplicitMedia() { // fn#42058, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4999:6716, offset: 0x0112f46b, size: 90 bytes, params: 1, frame: 14
|
|
var value;
|
|
const isFeatureAgeGated = (require(3835) /* metro dependency 3835: RegionalFeatureConfigUtils */).isFeatureAgeGated;
|
|
const AgeGatedFeature = (require(4861) /* metro dependency 4861: AgeGatedFeature */).AgeGatedFeature;
|
|
const SENSITIVE_CONTENT_SHOW_SETTING = AgeGatedFeature.SENSITIVE_CONTENT_SHOW_SETTING;
|
|
value = Reflect.apply(isFeatureAgeGated, value, [SENSITIVE_CONTENT_SHOW_SETTING]);
|
|
return value && (require(4813) /* metro dependency 4813: AgeVerificationUtils */).shouldShowTiggerPawtect();
|
|
}
|
|
|
|
function useShouldAgeVerifyForReason(a0) { // fn#42059, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4999:7001, offset: 0x0112f4c5, size: 72 bytes, params: 2, frame: 14
|
|
const value2 = useShouldAgeVerifyForExplicitMedia();
|
|
return !(value2 ? a0 == null : !value2) && (require(4840) /* metro dependency 4840: ObscureMediaModels */).AGE_VERIFICATION_OBSCURABLE_REASONS.has(a0);
|
|
}
|
|
|
|
function trackToggleMediaObscurityV2({obscure}) { // fn#42060, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4999:7181, offset: 0x0112f50d, size: 110 bytes, params: 2, frame: 16
|
|
var defaultImport;
|
|
const ageVerificationUtilsModule = require(4813) /* metro dependency 4813: AgeVerificationUtils */;
|
|
if (ageVerificationUtilsModule.isVerifiedAdult()) {
|
|
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
defaultImport.track(AnalyticEvents.EXPLICIT_MEDIA_OBSCURITY_TOGGLE_V2,
|
|
{toggle_direction: obscure ? 'hide' : 'show'});
|
|
}
|
|
}
|
|
|
|
function hasMessageSnapshotsWithAttachmentsOrEmbeds({message_snapshots}) { // fn#42061, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4999:7392, offset: 0x0112f57b, size: 40 bytes, params: 2, frame: 12
|
|
return message_snapshots?.some(function(a0) {
|
|
var r0;
|
|
var r1;
|
|
var property = a0.message;
|
|
var value = undefined;
|
|
if (property == null) {
|
|
r0 = value;
|
|
} else {
|
|
property = property.attachments;
|
|
r0 = property;
|
|
}
|
|
r0 = r0 != null && a0.message.attachments.length > 0;
|
|
if (!r0) {
|
|
property = a0.message;
|
|
r1 = property == null ? value : property.embeds;
|
|
value = r1 != null;
|
|
r1 = value && a0.message.embeds.length > 0;
|
|
r0 = r1;
|
|
}
|
|
return r0;
|
|
});
|
|
}
|
|
|
|
function handleExplicitMediaScanTimeoutForForwardedMessage({messageSnapshots}) { // fn#42055, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4999:6249, owner: handleExplicitMediaScanTimeoutForMessage.handleExplicitMediaScanTimeoutForForwardedMessage, offset: 0x0112f3bf, size: 47 bytes, params: 2, frame: 11
|
|
if (messageSnapshots == null) {
|
|
return messageSnapshots;
|
|
}
|
|
if (messageSnapshots.length === 0) {
|
|
return messageSnapshots;
|
|
}
|
|
return messageSnapshots.map(_fun42056);
|
|
}
|
|
|
|
function _fun42056(a0) { // fn#42056, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4999:6384, offset: 0x0112f3ee, size: 76 bytes, params: 2, frame: 14
|
|
const message = a0.message;
|
|
let value = environment.__proto__.__proto__;
|
|
value = timeoutAttachmentsAndEmbedsForMessage(message);
|
|
return a0.merge({message: message.merge({attachments: value.attachments, embeds: value.embeds})});
|
|
}
|
|
|