refactor: unify DM calls with server voice architecture

Merge connectDm() into connect() with isDm flag, eliminating ~145 lines
of duplicated LiveKit room setup. DM calls now inherit all event handlers
(SpeakingDetector cleanup, deafen broadcasts, metadata changes). Replace
monolithic DmCallView with shared VoiceGrid + VoiceControlBar components,
making DM calls group-DM-ready with full feature parity.
This commit is contained in:
Jannis Braun
2026-02-23 20:52:58 +01:00
parent 5e34b39b78
commit bc51fc6f7e
6 changed files with 61 additions and 458 deletions
@@ -106,8 +106,14 @@ export function VoiceControlBar() {
};
const handleDisconnect = () => {
wsSend({ type: 'voice_leave' });
useVoiceStore.getState().leaveVoice();
const { activeDmCall } = useVoiceStore.getState();
if (activeDmCall) {
wsSend({ type: 'dm_call_end', dmChannelId: activeDmCall.dmChannelId });
useVoiceStore.getState().setActiveDmCall(null);
} else {
wsSend({ type: 'voice_leave' });
useVoiceStore.getState().leaveVoice();
}
if (voiceFullscreen) {
useUIStore.getState().setVoiceFullscreen(false);
if (document.fullscreenElement) {