108 lines
5.3 KiB
TypeScript
108 lines
5.3 KiB
TypeScript
/* Metro module 8581; source: modules/age_gate/native/AgeGateUtils.tsx; dependencies: [1867, 3784, 1878, 661, 477, 5080, 8582, 1962, 7867, 2] */
|
|
import GuildStore from '../../../stores/GuildStore.tsx'; /* Metro dependency 1867 */
|
|
import UserStore from '../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
import PermissionStore from '../../../stores/PermissionStore.tsx'; /* Metro dependency 3784 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as PlatformUtilsModule from '../../../utils/PlatformUtils.tsx'; /* Metro dependency 477 */
|
|
import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
|
|
|
|
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 GuildNSFWContentLevel = ConstantsModule.GuildNSFWContentLevel;
|
|
const Set = global.Set;
|
|
const EXPLICIT = GuildNSFWContentLevel.EXPLICIT;
|
|
const AGE_RESTRICTED = GuildNSFWContentLevel.AGE_RESTRICTED;
|
|
const set = new Set([EXPLICIT, AGE_RESTRICTED]);
|
|
const isNSFWInvite2 = isNSFWInvite;
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/age_gate/native/AgeGateUtils.tsx');
|
|
exports.isNSFWInvite = isNSFWInvite2;
|
|
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 guildStoreBinding;
|
|
var defaultImport;
|
|
var pushLazy;
|
|
var value;
|
|
const value2 = undefined;
|
|
const moduleValue = require(dependencyMap[4]);
|
|
if (moduleValue.isIOS()) {
|
|
isNSFWInvite2 = isNSFWInvite(a0);
|
|
guildStoreBinding = GuildStore;
|
|
r1 = isNSFWInvite2 ? guildStoreBinding.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 permissionStoreBinding;
|
|
var nsfwLevel;
|
|
var value8;
|
|
var value9;
|
|
var nsfwAllowed;
|
|
var value;
|
|
if (PlatformUtilsModule.isIOS()) {
|
|
guild = GuildStore.getGuild(a0);
|
|
currentUser = UserStore.getCurrentUser();
|
|
if (guild == null) {
|
|
return false;
|
|
}
|
|
if (currentUser == null) {
|
|
return false;
|
|
}
|
|
permissionStoreBinding = PermissionStore;
|
|
r0 = permissionStoreBinding.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;
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun67879, 8581, [1867, 3784, 1878, 661, 477, 5080, 8582, 1962, 7867,
|
|
2]) /* metro module 8581, dependencies: [1867, 3784, 1878, 661, 477, 5080, 8582, 1962, 7867, 2] */;
|