decord/alpha/source/modules/voice_panel/VoicePanelManager.native.tsx

63 lines
2.2 KiB
TypeScript
Raw Normal View History

2026-10-09 10:00:15 +00:00
// Module ID: 18491
// Function ID: 18492
// Name: VoicePanelManager
2026-10-09 10:00:15 +00:00
// Dependencies: [2064, 5109, 6081, 6804, 2]
2026-07-23 10:11:24 +00:00
2026-10-09 10:00:15 +00:00
// Module 18491 (VoicePanelManager)
import ChannelStore from "ChannelStore" /* 2064 */;
import RTCConnectionStore from "RTCConnectionStore" /* 5109 */;
import VoicePanelStore from "VoicePanelStore" /* 6081 */;
import AutomaticLifecycleManager from "AutomaticLifecycleManager" /* 6804 */;
2026-10-03 08:58:59 +00:00
import size from "module_2" /* 2 */;
2026-07-20 16:05:17 +00:00
2026-10-03 08:58:59 +00:00
class VoicePanelManager extends AutomaticLifecycleManager {
constructor() {
const applyArgumentsResult = HermesBuiltin.applyArguments(this, new.target);
applyArgumentsResult.actions = {
VOICE_CHANNEL_SELECT() {
const channelId = RTCConnectionStore.getChannelId();
if (null != channelId) {
const state = VoicePanelStore.getState();
const channel = ChannelStore.getChannel(channelId);
let isGuildStageVoiceResult;
if (channel != null) {
isGuildStageVoiceResult = channel.isGuildStageVoice();
}
if (isGuildStageVoiceResult) {
state.closeChannel(channelId);
} else {
const channels = state.channels;
if (!channels.has(channelId)) {
state.openChannel(channelId);
}
}
2026-07-29 08:29:29 +00:00
}
2026-10-03 08:58:59 +00:00
},
RTC_CONNECTION_STATE() {
const channelId = RTCConnectionStore.getChannelId();
if (null != channelId) {
const state = VoicePanelStore.getState();
const channel = ChannelStore.getChannel(channelId);
let isGuildStageVoiceResult;
if (channel != null) {
isGuildStageVoiceResult = channel.isGuildStageVoice();
}
if (isGuildStageVoiceResult) {
state.closeChannel(channelId);
} else {
const channels = state.channels;
if (!channels.has(channelId)) {
state.openChannel(channelId);
}
}
2026-07-29 08:29:29 +00:00
}
}
2026-10-03 08:58:59 +00:00
};
return applyArgumentsResult;
}
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
const voicePanelManager = new VoicePanelManager();
const result = size.fileFinishedImporting("modules/voice_panel/VoicePanelManager.native.tsx");
2026-07-20 16:05:17 +00:00
2026-10-03 08:58:59 +00:00
export default voicePanelManager;