decord/source/modules/guild_rooms/GuildRoomManager.tsx

99 lines
3.7 KiB
TypeScript
Raw Normal View History

// Module ID: 17487
// Function ID: 17488
// Name: GuildRoomManager
// Dependencies: [502, 4794, 7221, 4836, 4792, 2]
2026-07-20 16:05:17 +00:00
// Module 17487 (GuildRoomManager)
import GuildRoomActionCreators from "GuildRoomActionCreators" /* 4792 */;
import GuildRoomsExperiment from "GuildRoomsExperiment" /* 4836 */;
import AuthenticationStore from "AuthenticationStore" /* 502 */;
import GuildRoomStore from "GuildRoomStore" /* 4794 */;
import AutomaticLifecycleManager from "AutomaticLifecycleManager" /* 7221 */;
2026-07-23 10:11:24 +00:00
require = fn;
const channelId = null;
const guildId = null;
2026-07-29 08:29:29 +00:00
class GuildRoomManager extends tmp2 {
constructor() {
applyArgumentsResult = HermesBuiltin.applyArguments(new.target, new.target);
closure_0 = applyArgumentsResult;
applyArgumentsResult.actions = {
VOICE_STATE_UPDATES(arg0) {
return applyArgumentsResult.handleVoiceStateUpdates(arg0);
},
2026-08-12 06:57:52 +00:00
CONNECTION_RESUMED() {
return applyArgumentsResult.handleConnectionResumed();
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
};
return applyArgumentsResult;
}
}
const prototype = GuildRoomManager.prototype;
2026-07-30 10:14:41 +00:00
prototype["isExperimentEnabled"] = function isExperimentEnabled(guildId, VOICE_STATE_UPDATE) {
return GuildRoomsExperiment.getGuildRoomsConfig({ guildId, location: VOICE_STATE_UPDATE }).enabled;
2026-07-29 08:29:29 +00:00
};
2026-07-30 10:14:41 +00:00
prototype["handleVoiceStateUpdates"] = function handleVoiceStateUpdates(arg0) {
2026-07-29 08:29:29 +00:00
const self = this;
2026-07-30 10:14:41 +00:00
const iter = arg0.voiceStates[Symbol.iterator]();
while (iter !== undefined) {
({ userId, guildId, channelId, sessionId, oldChannelId } = nextResult);
let obj = AuthenticationStore;
2026-07-30 10:14:41 +00:00
let tmp2 = userId;
if (userId === AuthenticationStore.getId()) {
2026-07-30 10:14:41 +00:00
if (sessionId === obj.getSessionId()) {
if (channelId !== channelId) {
let isExperimentEnabledResult = null != channelId;
if (isExperimentEnabledResult) {
isExperimentEnabledResult = null != guildId;
2026-07-20 16:05:17 +00:00
}
2026-07-30 10:14:41 +00:00
if (isExperimentEnabledResult) {
isExperimentEnabledResult = self.isExperimentEnabled(guildId, "VOICE_STATE_UPDATE");
}
if (isExperimentEnabledResult) {
let obj3 = GuildRoomActionCreators;
2026-07-30 10:14:41 +00:00
let guildRoomDisconnectResult = obj3.guildRoomDisconnect(guildId, channelId);
}
if (null != channelId) {
if (null != guildId) {
let pendingPosition = GuildRoomStore.getPendingPosition();
let pendingSeat = GuildRoomStore.getPendingSeat();
2026-07-30 10:14:41 +00:00
if (self.isExperimentEnabled(guildId, "VOICE_STATE_UPDATE")) {
let obj4 = GuildRoomActionCreators;
2026-08-28 06:19:39 +00:00
let guildRoomConnectResult = obj4.guildRoomConnect(guildId, channelId, pendingPosition, pendingSeat);
2026-07-30 10:14:41 +00:00
}
2026-07-29 08:29:29 +00:00
}
}
}
2026-07-30 10:14:41 +00:00
}
} else {
let tmp4 = null != oldChannelId;
if (tmp4) {
tmp4 = oldChannelId !== channelId;
}
if (tmp4) {
let obj2 = GuildRoomActionCreators;
2026-07-30 10:14:41 +00:00
let result = obj2.guildRoomLocalDisconnect(tmp2, oldChannelId);
2026-07-20 16:05:17 +00:00
}
}
2026-07-30 10:14:41 +00:00
continue;
}
2026-07-29 08:29:29 +00:00
};
2026-08-12 06:57:52 +00:00
prototype["handleConnectionResumed"] = function handleConnectionResumed() {
let isExperimentEnabledResult = null != channelId;
2026-08-12 06:57:52 +00:00
if (isExperimentEnabledResult) {
isExperimentEnabledResult = null != guildId;
2026-08-12 06:57:52 +00:00
}
if (isExperimentEnabledResult) {
const self = this;
isExperimentEnabledResult = this.isExperimentEnabled(guildId, "CONNECTION_RESUMED");
2026-08-12 06:57:52 +00:00
}
if (isExperimentEnabledResult) {
const guildRoom = GuildRoomActionCreators.fetchGuildRoom(guildId, channelId);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
};
const guildRoomManager = new GuildRoomManager();
const size = fn(2);
let result = size.fileFinishedImporting("modules/guild_rooms/GuildRoomManager.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default guildRoomManager;