decord/beta/source/modules/calls/ChannelCallManager.tsx
2026-10-07 22:43:51 +00:00

71 lines
3 KiB
TypeScript

// Module ID: 17473
// Function ID: 17474
// Name: ChannelCallManager
// Dependencies: [9563, 5437, 12466, 4723, 4909, 4914, 9562, 6613, 2]
// Module 17473 (ChannelCallManager)
import SoundpackStore from "SoundpackStore" /* 9563 */;
import CallStore from "CallStore" /* 5437 */;
import NotificationSettingsStore from "NotificationSettingsStore" /* 12466 */;
import StreamerModeStore from "StreamerModeStore" /* 4723 */;
import VoiceStateStore from "VoiceStateStore" /* 4909 */;
import SortedVoiceStateStore from "SortedVoiceStateStore" /* 4914 */;
import SoundUtils from "SoundUtils" /* 9562 */;
import AutomaticLifecycleManager from "AutomaticLifecycleManager" /* 6613 */;
import size from "module_2" /* 2 */;
let currentClientVoiceChannelId, map;
let closure_8 = SoundUtils.createSoundForPack("call_calling", SoundpackStore.getSoundpack());
class ChannelCallManager extends AutomaticLifecycleManager {
constructor() {
let disableSounds;
let soundDisabled;
let soundpack;
const applyArgumentsResult = HermesBuiltin.applyArguments(this, new.target);
require = applyArgumentsResult;
applyArgumentsResult._handleRing = function _handleRing(arg0) {
currentClientVoiceChannelId = currentClientVoiceChannelId.getCurrentClientVoiceChannelId(null);
const tmp2 = null != currentClientVoiceChannelId && SortedVoiceStateStore.countVoiceStatesForChannel(currentClientVoiceChannelId) >= 2;
if (null != currentClientVoiceChannelId) {
if (!tmp2) {
const tmp4 = arg0;
if (tmp4) {
if (!soundDisabled.isSoundDisabled("call_calling")) {
if (!disableSounds.disableSounds) {
closure_8.loop();
}
}
}
}
}
closure_8.stop();
};
applyArgumentsResult.handleSoundpackUpdate = function handleSoundpackUpdate() {
closure_8.stop();
const obj = SoundUtils;
closure_8 = obj.createSoundForPack("call_calling", soundpack.getSoundpack());
};
applyArgumentsResult.handleRingUpdate = function handleRingUpdate() {
const calls = CallStore.getCalls();
require._handleRing(calls.some((ringing) => {
const tmp = ringing.ringing.length > 0 && currentClientVoiceChannelId.getCurrentClientVoiceChannelId(null) === ringing.channelId;
return tmp;
}));
};
return applyArgumentsResult;
}
_initialize() {
map = new Map();
const result = map.set(CallStore, this.handleRingUpdate);
const result1 = result.set(NotificationSettingsStore, this.handleRingUpdate);
const result2 = result1.set(StreamerModeStore, this.handleRingUpdate);
const result3 = result2.set(VoiceStateStore, this.handleRingUpdate);
this.stores = result3.set(SoundpackStore, this.handleSoundpackUpdate);
}
}
const prototype = ChannelCallManager.prototype;
const channelCallManager = new ChannelCallManager();
let result = size.fileFinishedImporting("modules/calls/ChannelCallManager.tsx");
export default channelCallManager;