decord/source/modules/calls/ChannelCallManager.tsx

152 lines
6 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 16669
// Function ID: 16670
2026-07-29 08:29:29 +00:00
// Name: _initialize
2026-08-25 06:04:03 +00:00
// Dependencies: [9936, 5103, 1391, 9909, 1981, 4225, 4399, 4455, 4396, 9935, 5367, 2]
2026-07-20 16:05:17 +00:00
2026-08-25 06:04:03 +00:00
// Module 16669 (_initialize)
import initializeDefault from "initialize" /* 5367 */;
import importDefaultResult from "Soundpacks" /* 9936 */;
import closure_3 from "callConnect" /* 5103 */;
2026-08-24 06:08:38 +00:00
import closure_4 from "ensureGuildLoaded" /* 1391 */;
2026-08-25 06:04:03 +00:00
import closure_5 from "DesktopNotificationTypes" /* 9909 */;
import closure_6 from "handleConnectionOpen" /* 1981 */;
import closure_7 from "initialize" /* 4225 */;
import closure_8 from "updateVoiceState" /* 4399 */;
import closure_9 from "getVoiceStatesForGuild" /* 4455 */;
import closure_10 from "getParticipants" /* 4396 */;
import createSoundForPack from "createSoundForPack" /* 9935 */;
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
let require = arg1;
let closure_11 = createSoundForPack.createSoundForPack("call_calling", importDefaultResult.getSoundpack());
2026-08-24 06:08:38 +00:00
initializeDefault;
2026-07-29 08:29:29 +00:00
// CreatePrivateName (0x9e)
class ChannelCallManager extends tmp2 {
constructor() {
applyArgumentsResult = HermesBuiltin.applyArguments(new.target, new.target);
closure_0 = applyArgumentsResult;
// PrivateIsIn (0x32)
if (tmp) {
str = "Cannot initialize private field twice.";
throwTypeErrorResult = HermesBuiltin.throwTypeError();
return;
} else {
tmp5 = tmp4;
// AddOwnPrivateBySym (0x64)
obj = { GUILD_LOCAL_RING_START: null, GUILD_RING_STOP: null };
obj[0] = function GUILD_LOCAL_RING_START(arg0) {
return applyArgumentsResult.handleGuildRingStart(arg0);
};
obj[1] = function GUILD_RING_STOP(arg0) {
return applyArgumentsResult.handleGuildRingStop(arg0);
};
applyArgumentsResult.actions = obj;
applyArgumentsResult._handleRing = function _handleRing(someResult, guildId) {
currentClientVoiceChannelId = currentClientVoiceChannelId.getCurrentClientVoiceChannelId(guildId);
let tmp2 = null != currentClientVoiceChannelId;
if (tmp2) {
2026-08-24 06:08:38 +00:00
tmp2 = closure_9.countVoiceStatesForChannel(currentClientVoiceChannelId) >= 2;
2026-07-29 08:29:29 +00:00
}
if (null != currentClientVoiceChannelId) {
if (!tmp2) {
if (someResult) {
if (!soundDisabled.isSoundDisabled("call_calling")) {
if (!disableSounds.disableSounds) {
closure_11.loop();
}
}
}
}
}
closure_11.stop();
};
applyArgumentsResult.handleSoundpackUpdate = function handleSoundpackUpdate() {
closure_11.stop();
closure_11 = applyArgumentsResult(table[9]).createSoundForPack("call_calling", soundpack.getSoundpack());
};
applyArgumentsResult.handleRingUpdate = function handleRingUpdate() {
2026-08-24 06:08:38 +00:00
const channel = closure_1_4.getChannel(closure_1_6.getVoiceChannelId());
2026-07-29 08:29:29 +00:00
let guild_id;
if (channel != null) {
guild_id = channel.guild_id;
}
if (guild_id == null) {
guild_id = null;
}
2026-08-24 06:08:38 +00:00
const calls = closure_1_3.getCalls();
2026-07-29 08:29:29 +00:00
let someResult = calls.some((ringing) => {
let tmp = ringing.ringing.length > 0;
if (tmp) {
tmp = currentClientVoiceChannelId.getCurrentClientVoiceChannelId(null) === ringing.channelId;
}
return tmp;
});
if (!someResult) {
// GetOwnPrivateBySym (0x65)
2026-08-24 06:08:38 +00:00
someResult = closure_1_12.size > 0;
2026-07-29 08:29:29 +00:00
}
applyArgumentsResult._handleRing(someResult, guild_id);
};
applyArgumentsResult.handleGuildRingStart = function handleGuildRingStart(arg0) {
({ ringing, guildId } = arg0);
const item = ringing.forEach((arg0) => {
// GetOwnPrivateBySym (0x65)
obj.add(arg0);
});
// GetOwnPrivateBySym (0x65)
2026-08-24 06:08:38 +00:00
applyArgumentsResult._handleRing(closure_1_12.size > 0, guildId);
2026-07-29 08:29:29 +00:00
};
applyArgumentsResult.handleGuildRingStop = function handleGuildRingStop(arg0) {
({ ringing, guildId } = arg0);
const item = ringing.forEach((arg0) => {
// GetOwnPrivateBySym (0x65)
obj.delete(arg0);
});
// GetOwnPrivateBySym (0x65)
2026-08-24 06:08:38 +00:00
applyArgumentsResult._handleRing(closure_1_12.size > 0, guildId);
2026-07-29 08:29:29 +00:00
};
applyArgumentsResult.handleChannelRTCStoreChange = function handleChannelRTCStoreChange() {
2026-08-24 06:08:38 +00:00
const voiceChannelId = closure_1_6.getVoiceChannelId();
2026-07-29 08:29:29 +00:00
// GetOwnPrivateBySym (0x65)
if (tmp.size > 0) {
if (null == voiceChannelId) {
const _Set = Set;
new Set();
// PutOwnPrivateBySym (0x66)
// GetOwnPrivateBySym (0x65)
obj._handleRing(tmp4.size > 0, null);
} else if (null != voiceChannelId) {
2026-08-24 06:08:38 +00:00
const guildRingingUsers = closure_1_10.getGuildRingingUsers(voiceChannelId);
2026-07-29 08:29:29 +00:00
const _Set2 = Set;
// GetOwnPrivateBySym (0x65)
const items = [];
HermesBuiltin.arraySpread(tmp2, 0);
const set1 = new Set(items.filter((arg0) => !set.has(arg0)));
if (set1.size > 0) {
const forEach = set1.forEach;
const item = forEach((arg0) => {
// GetOwnPrivateBySym (0x65)
obj.delete(arg0);
});
// GetOwnPrivateBySym (0x65)
obj._handleRing(forEach.size > 0, null);
}
}
}
};
return applyArgumentsResult;
}
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
ChannelCallManager.prototype["_initialize"] = function _initialize() {
2026-08-24 06:08:38 +00:00
const result = new Map().set(closure_3, this.handleRingUpdate);
const result1 = result.set(closure_5, this.handleRingUpdate);
const result2 = result1.set(closure_7, this.handleRingUpdate);
const result3 = result2.set(closure_8, this.handleRingUpdate);
const result4 = result3.set(closure_10, this.handleChannelRTCStoreChange);
2026-07-29 08:29:29 +00:00
this.stores = result4.set(closure_2, this.handleSoundpackUpdate);
};
const channelCallManager = new ChannelCallManager();
2026-08-24 06:08:38 +00:00
let result = require("set").fileFinishedImporting("modules/calls/ChannelCallManager.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default channelCallManager;