100 lines
4.5 KiB
TypeScript
100 lines
4.5 KiB
TypeScript
/* Metro module 8581; source: modules/age_gate/native/AgeGateUtils.tsx; dependencies: [1867, 3784, 1878, 661, 477, 5080, 8582, 1962, 7867, 2] */
|
|
function _fun67879(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#67879, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8766:6, offset: 0x01c36606, size: 271 bytes, params: 8, frame: 20
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
|
|
const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */;
|
|
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
|
|
const constantsModule = require(661) /* metro dependency 661: Constants */;
|
|
const GuildNSFWContentLevel = constantsModule.GuildNSFWContentLevel;
|
|
const env0_7 = constantsModule.Permissions;
|
|
const Set = global.Set;
|
|
const EXPLICIT = GuildNSFWContentLevel.EXPLICIT;
|
|
const AGE_RESTRICTED = GuildNSFWContentLevel.AGE_RESTRICTED;
|
|
const set = new Set([EXPLICIT, AGE_RESTRICTED]);
|
|
const closure = isNSFWInvite;
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/age_gate/native/AgeGateUtils.tsx');
|
|
exports.isNSFWInvite = closure;
|
|
exports.handleNSFWGuildInvite = handleNSFWGuildInvite;
|
|
exports.shouldNSFWGateGuild = shouldNSFWGateGuild;
|
|
}
|
|
|
|
function isNSFWInvite(a0) { // fn#67880, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8766:232, offset: 0x01c36715, size: 67 bytes, params: 2, frame: 16
|
|
const binding = env0_8;
|
|
return binding.has((a0 == null || a0.guild == null ? undefined : a0.guild.nsfw_level) ?? GuildNSFWContentLevel.DEFAULT);
|
|
}
|
|
|
|
function handleNSFWGuildInvite(a0) { // fn#67881, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8766:454, offset: 0x01c36758, size: 222 bytes, params: 2, frame: 19
|
|
var r1;
|
|
var r0;
|
|
var isNSFWInvite2;
|
|
var defaultImport;
|
|
var pushLazy;
|
|
var value;
|
|
const value2 = undefined;
|
|
const moduleValue = require(dependencyMap[4]);
|
|
if (moduleValue.isIOS()) {
|
|
isNSFWInvite2 = isNSFWInvite(a0);
|
|
r1 = isNSFWInvite2 ? GuildStore.getGuild(a0 == null || a0.guild == null ? value2 : a0.guild.id) != null : !isNSFWInvite2;
|
|
if (r1) {
|
|
r0 = !r1;
|
|
} else {
|
|
defaultImport = importDefault(dependencyMap[5]);
|
|
pushLazy = defaultImport.pushLazy;
|
|
value = require(dependencyMap[7]);
|
|
value = value(dependencyMap[6], dependencyMap.paths);
|
|
Reflect.apply(pushLazy, defaultImport, [value,
|
|
{guildId: a0 == null || a0.guild == null ? value2 : a0.guild.id}]);
|
|
value = true;
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
function shouldNSFWGateGuild(a0) { // fn#67882, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8766:709, offset: 0x01c36836, size: 310 bytes, params: 2, frame: 17
|
|
var r0;
|
|
var r3;
|
|
var guild;
|
|
var currentUser;
|
|
var nsfwLevel;
|
|
var value8;
|
|
var value9;
|
|
var nsfwAllowed;
|
|
var value;
|
|
const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */;
|
|
if (platformUtilsModule.isIOS()) {
|
|
guild = GuildStore.getGuild(a0);
|
|
currentUser = UserStore.getCurrentUser();
|
|
if (guild == null) {
|
|
return false;
|
|
}
|
|
if (currentUser == null) {
|
|
return false;
|
|
}
|
|
r0 = PermissionStore.can(Permissions.ADMINISTRATOR, guild) || PermissionStore.can(Permissions.MANAGE_GUILD,
|
|
guild);
|
|
r0 = !r0 ? PermissionStore.can(Permissions.KICK_MEMBERS, guild) : r0;
|
|
r0 = !r0 ? PermissionStore.can(Permissions.BAN_MEMBERS, guild) : r0;
|
|
nsfwLevel = guild.nsfwLevel;
|
|
value8 = nsfwLevel === GuildNSFWContentLevel.AGE_RESTRICTED;
|
|
nsfwLevel = guild.nsfwLevel;
|
|
value9 = nsfwLevel === GuildNSFWContentLevel.EXPLICIT;
|
|
nsfwAllowed = currentUser.nsfwAllowed;
|
|
if (nsfwAllowed) {
|
|
value = require(7867) /* metro dependency 7867: AgeRestrictedContentSettingsUtils */;
|
|
value = value.getViewNsfwGuildsOrDefault();
|
|
r3 = value;
|
|
} else {
|
|
r3 = nsfwAllowed;
|
|
}
|
|
value = !r0;
|
|
r0 = r0 ? value : value9 ? !!value9 : value8 && !r3;
|
|
return r0;
|
|
}
|
|
return false;
|
|
}
|
|
|