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

72 lines
3 KiB
TypeScript
Raw Normal View History

2026-10-09 10:00:15 +00:00
// Module ID: 17936
// Function ID: 17937
// Name: ChannelCallManager
2026-10-09 10:00:15 +00:00
// Dependencies: [10941, 5755, 12517, 4924, 5112, 5115, 10940, 6804, 2]
2026-07-20 16:05:17 +00:00
2026-10-09 10:00:15 +00:00
// Module 17936 (ChannelCallManager)
import SoundpackStore from "SoundpackStore" /* 10941 */;
import CallStore from "CallStore" /* 5755 */;
import NotificationSettingsStore from "NotificationSettingsStore" /* 12517 */;
import StreamerModeStore from "StreamerModeStore" /* 4924 */;
import VoiceStateStore from "VoiceStateStore" /* 5112 */;
import SortedVoiceStateStore from "SortedVoiceStateStore" /* 5115 */;
import SoundUtils from "SoundUtils" /* 10940 */;
import AutomaticLifecycleManager from "AutomaticLifecycleManager" /* 6804 */;
2026-10-03 08:58:59 +00:00
import size from "module_2" /* 2 */;
let currentClientVoiceChannelId, map;
2026-07-23 10:11:24 +00:00
let closure_8 = SoundUtils.createSoundForPack("call_calling", SoundpackStore.getSoundpack());
2026-10-03 08:58:59 +00:00
class ChannelCallManager extends AutomaticLifecycleManager {
2026-07-29 08:29:29 +00:00
constructor() {
2026-10-03 08:58:59 +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-03 08:58:59 +00:00
const tmp2 = null != currentClientVoiceChannelId && SortedVoiceStateStore.countVoiceStatesForChannel(currentClientVoiceChannelId) >= 2;
if (null != currentClientVoiceChannelId) {
if (!tmp2) {
2026-10-03 08:58:59 +00:00
const tmp4 = arg0;
if (tmp4) {
if (!soundDisabled.isSoundDisabled("call_calling")) {
if (!disableSounds.disableSounds) {
closure_8.loop();
2026-07-29 08:29:29 +00:00
}
}
}
}
}
closure_8.stop();
};
applyArgumentsResult.handleSoundpackUpdate = function handleSoundpackUpdate() {
closure_8.stop();
2026-10-03 08:58:59 +00:00
const obj = SoundUtils;
closure_8 = obj.createSoundForPack("call_calling", soundpack.getSoundpack());
};
applyArgumentsResult.handleRingUpdate = function handleRingUpdate() {
const calls = CallStore.getCalls();
2026-10-03 08:58:59 +00:00
require._handleRing(calls.some((ringing) => {
const tmp = ringing.ringing.length > 0 && currentClientVoiceChannelId.getCurrentClientVoiceChannelId(null) === ringing.channelId;
return tmp;
}));
};
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +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-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
const prototype = ChannelCallManager.prototype;
2026-07-29 08:29:29 +00:00
const channelCallManager = new ChannelCallManager();
let result = size.fileFinishedImporting("modules/calls/ChannelCallManager.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default channelCallManager;