feat: add federatedCallId and callOrigin to client call routing

Enable federated DM calls to route accept/reject/end through the correct
WebSocket connection using callOrigin, and include federatedCallId in all
dm_call payloads for server-side FederatedCallEntry lookup.
This commit is contained in:
Jannis Braun
2026-04-08 03:26:48 +02:00
parent 0c57f9491f
commit ba7b975bc8
10 changed files with 73 additions and 31 deletions
@@ -75,9 +75,10 @@ export function VoiceControls() {
};
const handleDisconnect = () => {
const { activeDmCall, disconnectFn } = useVoiceStore.getState();
const { activeDmCall, disconnectFn, federatedCallId, callOrigin } = useVoiceStore.getState();
if (activeDmCall) {
wsSend({ type: 'dm_call_end', dmChannelId: activeDmCall.dmChannelId }, getChannelOrigin(activeDmCall.dmChannelId));
const origin = callOrigin || getChannelOrigin(activeDmCall.dmChannelId);
wsSend({ type: 'dm_call_end', dmChannelId: activeDmCall.dmChannelId, federatedCallId }, origin);
useVoiceStore.getState().setActiveDmCall(null);
} else {
wsSend({ type: 'voice_leave' }, voiceOrigin);