decord/beta/source/modules/calls/ChannelCallManager.tsx

72 lines
2.9 KiB
TypeScript
Raw Normal View History

// Module ID: 17112
// Function ID: 17113
// Name: ChannelCallManager
// Dependencies: [9358, 5590, 9541, 4679, 4855, 4860, 9357, 6539, 2]
// Module 17112 (ChannelCallManager)
import SoundpackStore from "SoundpackStore" /* 9358 */;
import CallStore from "CallStore" /* 5590 */;
import NotificationSettingsStore from "NotificationSettingsStore" /* 9541 */;
import StreamerModeStore from "StreamerModeStore" /* 4679 */;
import VoiceStateStore from "VoiceStateStore" /* 4855 */;
import SortedVoiceStateStore from "SortedVoiceStateStore" /* 4860 */;
2026-10-01 14:13:23 +00:00
import SoundUtils from "SoundUtils" /* 9357 */;
import AutomaticLifecycleManager from "AutomaticLifecycleManager" /* 6539 */;
2026-10-01 14:13:23 +00:00
import size from "module_2" /* 2 */;
let currentClientVoiceChannelId, map;
let closure_8 = SoundUtils.createSoundForPack("call_calling", SoundpackStore.getSoundpack());
2026-10-01 14:13:23 +00:00
class ChannelCallManager extends AutomaticLifecycleManager {
constructor() {
2026-10-01 14:13:23 +00:00
let disableSounds;
let soundDisabled;
let soundpack;
const applyArgumentsResult = HermesBuiltin.applyArguments(this, new.target);
require = applyArgumentsResult;
applyArgumentsResult._handleRing = function _handleRing(arg0) {
currentClientVoiceChannelId = currentClientVoiceChannelId.getCurrentClientVoiceChannelId(null);
2026-10-01 14:13:23 +00:00
const tmp2 = null != currentClientVoiceChannelId && SortedVoiceStateStore.countVoiceStatesForChannel(currentClientVoiceChannelId) >= 2;
if (null != currentClientVoiceChannelId) {
if (!tmp2) {
2026-10-01 14:13:23 +00:00
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();
2026-10-01 14:13:23 +00:00
const obj = SoundUtils;
closure_8 = obj.createSoundForPack("call_calling", soundpack.getSoundpack());
};
applyArgumentsResult.handleRingUpdate = function handleRingUpdate() {
const calls = CallStore.getCalls();
2026-10-01 14:13:23 +00:00
require._handleRing(calls.some((ringing) => {
const tmp = ringing.ringing.length > 0 && currentClientVoiceChannelId.getCurrentClientVoiceChannelId(null) === ringing.channelId;
return tmp;
}));
};
return applyArgumentsResult;
}
2026-10-01 14:13:23 +00:00
_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);
}
}
2026-10-01 14:13:23 +00:00
const prototype = ChannelCallManager.prototype;
const channelCallManager = new ChannelCallManager();
let result = size.fileFinishedImporting("modules/calls/ChannelCallManager.tsx");
export default channelCallManager;