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

84 lines
3.3 KiB
TypeScript
Raw Normal View History

// Module ID: 17307
// Function ID: 17308
2026-07-29 08:29:29 +00:00
// Name: handlePostConnectionOpen
// Dependencies: [5, 1957, 2011, 4381, 1098, 1074, 7118, 4771, 4763, 17308, 1896, 1093, 2]
2026-07-20 16:05:17 +00:00
// Module 17307 (handlePostConnectionOpen)
import _modDef4763 from "module_4763" /* 4763 */;
import shouldShowAgeGateForVoiceChannel from "shouldShowAgeGateForVoiceChannel" /* 4771 */;
import initializeDefault from "initialize" /* 7118 */;
2026-08-24 06:08:38 +00:00
import closure_3 from "asyncGeneratorStep" /* 5 */;
import closure_4 from "ensureGuildLoaded" /* 1957 */;
import closure_5 from "handleConnectionOpen" /* 2011 */;
import closure_6 from "handleConnectionOpen" /* 4381 */;
import result from "result" /* 1098 */;
import ME from "ME" /* 1074 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
({ EXISTING_USER_AGE_GATE_MODAL_KEY: error, AgeGateSource: closure_8 } = result);
2026-07-29 08:29:29 +00:00
({ ChannelTypes: c9, GuildNSFWContentLevel: c10 } = ME);
2026-08-24 06:08:38 +00:00
initializeDefault;
2026-07-29 08:29:29 +00:00
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-24 06:08:38 +00:00
shouldShowAgeGateForVoiceChannel.maybeShowAgeGate(guildId, channelId);
2026-07-29 08:29:29 +00:00
};
prototype["handleChannelSelect"] = function handleChannelSelect(arg0) {
({ 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-24 06:08:38 +00:00
shouldShowAgeGateForVoiceChannel.maybeShowAgeGate(guildId, channelId);
const obj = shouldShowAgeGateForVoiceChannel;
2026-07-29 08:29:29 +00:00
}
};
prototype["handleAgeGateModalOpen"] = function handleAgeGateModalOpen(source) {
source = source.source;
_modDef4763.pushLazy(callback(function*() {
2026-08-24 06:08:38 +00:00
closure_1 = tmp5;
closure_0 = tmp2;
yield closure_1_0(paths[10])(paths[9], paths.paths);
2026-08-04 21:03:28 +00:00
closure_0 = arg1.default;
2026-08-24 06:08:38 +00:00
if (closure_0 === closure_1_8.AUTH) {
2026-08-04 21:03:28 +00:00
const obj = { animation: null };
2026-08-24 06:08:38 +00:00
obj[0] = closure_1_0(paths[11]).ModalAnimation.SLIDE_IN_OUT;
closure_1_0.modalConfig = obj;
2026-07-29 08:29:29 +00:00
}
2026-08-24 06:08:38 +00:00
return closure_1_0;
2026-07-29 08:29:29 +00:00
}), { source }, closure_7);
};
prototype["handleAgeGateModalClose"] = function handleAgeGateModalClose() {
_modDef4763.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-24 06:08:38 +00:00
shouldShowAgeGateForVoiceChannel.maybeShowAgeGate(guild.id, null);
const obj = shouldShowAgeGateForVoiceChannel;
2026-07-29 08:29:29 +00:00
}
};
const ageGateManager = new AgeGateManager();
2026-08-24 06:08:38 +00:00
result = require("set").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;