Files
discord-decomp/sources/modules/parent_tools/FamilyCenterControlledSettingsUtils.tsx
T
2026-07-27 16:20:00 +03:00

80 lines
6.6 KiB
TypeScript

/* Metro module 13351; source: modules/parent_tools/FamilyCenterControlledSettingsUtils.tsx; dependencies: [1314, 13348, 4844, 4842, 2] */
function _fun101675(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#101675, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13541:6, offset: 0x0221baf5, size: 177 bytes, params: 8, frame: 20
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const closure = isSetAndNotDefault;
const closure2 = getGoreContentSettingOrDefault_101677;
const closure3 = resolveExplicitContentSettingWithDefaultsForTeen;
const closure4 = getExplicitContentSettingOrDefault_101679;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/parent_tools/FamilyCenterControlledSettingsUtils.tsx');
exports.isSetAndNotDefault = closure;
exports.getGoreContentSettingOrDefault = closure2;
exports.updateGoreContentSetting = updateGoreContentSetting_101680;
exports.resolveExplicitContentSettingWithDefaultsForTeen = closure3;
exports.getExplicitContentSettingOrDefault = closure4;
exports.updateExplicitContentSetting = updateExplicitContentSetting_101681;
}
function isSetAndNotDefault(a0) { // fn#101676, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13541:115, offset: 0x0221bba6, size: 54 bytes, params: 2, frame: 13
return a0 != null && a0 !== (require(1314) /* metro dependency 1314: preloaded_user_settings */).ExplicitContentRedaction.UNSET_EXPLICIT_CONTENT_REDACTION;
}
function getGoreContentSettingOrDefault_101677(a0) { // fn#101677, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13541:228, offset: 0x0221bbdc, size: 224 bytes, params: 2, frame: 17
const ParentalControlledGoreContent = (require(13348) /* metro dependency 13348: ParentalControlledUserSettings */).ParentalControlledGoreContent;
const {goreContentNonFriendDm, goreContentFriendDm} = ParentalControlledGoreContent.getControlledSetting(a0) ?? ({});
const object2 = {};
object2.goreContentNonFriendDm = isSetAndNotDefault(goreContentNonFriendDm) ? goreContentNonFriendDm : (require(4844) /* metro dependency 4844: SensitiveMediaGoreRedactionSettingsUtils */).resolveGoreSettingWithDefaultsForTeen({isDm: true});
object2.goreContentFriendDm = isSetAndNotDefault(goreContentFriendDm) ? goreContentFriendDm : (require(4844) /* metro dependency 4844: SensitiveMediaGoreRedactionSettingsUtils */).resolveGoreSettingWithDefaultsForTeen({'isDm': true,
'isFriend': true});
const ExplicitContentRedaction = (require(1314) /* metro dependency 1314: preloaded_user_settings */).ExplicitContentRedaction;
const BLUR = ExplicitContentRedaction.BLUR;
object2.goreContentGuilds = BLUR;
return object2;
}
function resolveExplicitContentSettingWithDefaultsForTeen({teenId, setting, isFriend}) { // fn#101678, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13541:697, offset: 0x0221bcbc, size: 130 bytes, params: 2, frame: 16
isFriend = !(isFriend === undefined) && isFriend;
if (isSetAndNotDefault(setting)) {
return setting;
}
const ParentalControlledLegacyExplicitContent = (require(13348) /* metro dependency 13348: ParentalControlledUserSettings */).ParentalControlledLegacyExplicitContent;
const controlledSetting = ParentalControlledLegacyExplicitContent.getControlledSetting(teenId);
const value = require(4842) /* metro dependency 4842: SensitiveMediaExplicitRedactionSettingsUtils */;
return isFriend ? value.TEEN_EXPLICIT_CONTENT_FILTER_TO_EXPLICIT_CONTENT_REDACTION_FRIEND_DM[controlledSetting] : value.TEEN_EXPLICIT_CONTENT_FILTER_TO_EXPLICIT_CONTENT_REDACTION_NON_FRIEND_DM[controlledSetting];
}
function getExplicitContentSettingOrDefault_101679(a0) { // fn#101679, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13541:1057, offset: 0x0221bd3e, size: 176 bytes, params: 2, frame: 18
const value2 = undefined;
const ParentalControlledExplicitContent = (require(13348) /* metro dependency 13348: ParentalControlledUserSettings */).ParentalControlledExplicitContent;
const controlledSetting = ParentalControlledExplicitContent.getControlledSetting(a0);
const object2 = {};
object2.explicitContentNonFriendDm = resolveExplicitContentSettingWithDefaultsForTeen({teenId: a0,
setting: controlledSetting == null ? value2 : controlledSetting.explicitContentNonFriendDm});
object2.explicitContentFriendDm = resolveExplicitContentSettingWithDefaultsForTeen({teenId: a0,
setting: controlledSetting == null ? value2 : controlledSetting.explicitContentFriendDm, isFriend: true});
const ExplicitContentRedaction = (require(1314) /* metro dependency 1314: preloaded_user_settings */).ExplicitContentRedaction;
const BLUR = ExplicitContentRedaction.BLUR;
object2.explicitContentGuilds = BLUR;
return object2;
}
function updateGoreContentSetting_101680(a0, a1) { // fn#101680, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13541:1713, offset: 0x0221bdee, size: 76 bytes, params: 3, frame: 15
const goreContentSettingOrDefault_101677 = getGoreContentSettingOrDefault_101677(a0);
const ParentalControlledGoreContent = (require(13348) /* metro dependency 13348: ParentalControlledUserSettings */).ParentalControlledGoreContent;
const updateControlledSetting = ParentalControlledGoreContent.updateControlledSetting;
const object2 = {};
copyDataProperties(object2, a1, copyDataProperties(object2, goreContentSettingOrDefault_101677, undefined));
Reflect.apply(updateControlledSetting, ParentalControlledGoreContent, [a0, object2]);
}
function updateExplicitContentSetting_101681(a0, a1) { // fn#101681, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13541:2042, offset: 0x0221be3a, size: 76 bytes, params: 3, frame: 15
const explicitContentSettingOrDefault_101679 = getExplicitContentSettingOrDefault_101679(a0);
const ParentalControlledExplicitContent = (require(13348) /* metro dependency 13348: ParentalControlledUserSettings */).ParentalControlledExplicitContent;
const updateControlledSetting = ParentalControlledExplicitContent.updateControlledSetting;
const object2 = {};
copyDataProperties(object2, a1, copyDataProperties(object2, explicitContentSettingOrDefault_101679, undefined));
Reflect.apply(updateControlledSetting, ParentalControlledExplicitContent, [a0, object2]);
}