decord/source/modules/age_gate/native/AgeGateManager.tsx

87 lines
3.3 KiB
TypeScript
Raw Normal View History

2026-08-05 07:35:12 +00:00
// Module ID: 16222
// Function ID: 16223
2026-07-29 08:29:29 +00:00
// Name: handlePostConnectionOpen
2026-08-05 07:35:12 +00:00
// Dependencies: [5, 1372, 1931, 4072, 1221, 676, 5214, 4468, 4460, 16223, 1959, 691, 2]
2026-07-20 16:05:17 +00:00
2026-08-05 07:35:12 +00:00
// Module 16222 (handlePostConnectionOpen)
2026-07-29 08:29:29 +00:00
import closure_3 from "ME";
import ensureGuildLoaded from "ensureGuildLoaded";
import handleConnectionOpen from "handleConnectionOpen";
import closure_6 from "handleConnectionOpen";
2026-07-23 10:11:24 +00:00
import result from "result";
import ME from "ME";
2026-07-29 08:29:29 +00:00
import "initialize";
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
let c10;
let c9;
let error;
let metroImportAll;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
({ EXISTING_USER_AGE_GATE_MODAL_KEY: error, AgeGateSource: metroImportAll } = result);
({ ChannelTypes: c9, GuildNSFWContentLevel: c10 } = ME);
class AgeGateManager extends tmp4 {
constructor() {
applyArgumentsResult = HermesBuiltin.applyArguments(new.target, new.target);
applyArgumentsResult.actions = { POST_CONNECTION_OPEN: applyArgumentsResult.handlePostConnectionOpen, CHANNEL_SELECT: applyArgumentsResult.handleChannelSelect, AGE_GATE_MODAL_OPEN: applyArgumentsResult.handleAgeGateModalOpen, AGE_GATE_MODAL_CLOSE: applyArgumentsResult.handleAgeGateModalClose, GUILD_UPDATE: applyArgumentsResult.handleGuildUpdate };
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
const prototype = AgeGateManager.prototype;
prototype["handlePostConnectionOpen"] = function handlePostConnectionOpen() {
const guildId = store.getGuildId();
channelId = channelId.getChannelId();
2026-08-05 07:35:12 +00:00
require(4468) /* shouldShowAgeGateForVoiceChannel */.maybeShowAgeGate(guildId, channelId);
2026-07-29 08:29:29 +00:00
};
prototype["handleChannelSelect"] = function handleChannelSelect(arg0) {
let channelId;
let guildId;
({ guildId, channelId } = arg0);
channel = channel.getChannel(channelId);
let tmp2 = null != guildId;
if (tmp2) {
let type;
if (channel != null) {
type = channel.type;
}
tmp2 = type !== constants.GUILD_VOICE;
}
if (tmp2) {
2026-08-05 07:35:12 +00:00
require(4468) /* shouldShowAgeGateForVoiceChannel */.maybeShowAgeGate(guildId, channelId);
const obj = require(4468) /* shouldShowAgeGateForVoiceChannel */;
2026-07-29 08:29:29 +00:00
}
};
prototype["handleAgeGateModalOpen"] = function handleAgeGateModalOpen(source) {
source = source.source;
2026-08-05 07:35:12 +00:00
importDefault(4460).pushLazy(callback(function*() {
2026-08-04 21:03:28 +00:00
let closure_1 = tmp5;
let closure_0 = tmp2;
yield outer1_0(paths[10])(paths[9], paths.paths);
closure_0 = arg1.default;
if (closure_0 === outer1_8.AUTH) {
const obj = { animation: null };
obj[0] = outer1_0(paths[11]).ModalAnimation.SLIDE_IN_OUT;
outer1_0.modalConfig = obj;
2026-07-29 08:29:29 +00:00
}
2026-08-04 21:03:28 +00:00
return outer1_0;
2026-07-29 08:29:29 +00:00
}), { source }, closure_7);
};
prototype["handleAgeGateModalClose"] = function handleAgeGateModalClose() {
2026-08-05 07:35:12 +00:00
importDefault(4460).popWithKey(closure_7);
2026-07-29 08:29:29 +00:00
};
prototype["handleGuildUpdate"] = function handleGuildUpdate(guild) {
guild = guild.guild;
const guildId = store.getGuildId();
let tmp2 = null != guildId && guild.id === guildId;
if (tmp2) {
tmp2 = guild.owner_configured_content_level === constants2.AGE_RESTRICTED;
}
if (tmp2) {
2026-08-05 07:35:12 +00:00
require(4468) /* shouldShowAgeGateForVoiceChannel */.maybeShowAgeGate(guild.id, null);
const obj = require(4468) /* shouldShowAgeGateForVoiceChannel */;
2026-07-29 08:29:29 +00:00
}
};
const ageGateManager = new AgeGateManager();
result = require("handleConnectionOpen").fileFinishedImporting("modules/age_gate/native/AgeGateManager.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default ageGateManager;