diff --git a/src/app/components/CallEmbedProvider.tsx b/src/app/components/CallEmbedProvider.tsx index c0621e123..56d73365b 100644 --- a/src/app/components/CallEmbedProvider.tsx +++ b/src/app/components/CallEmbedProvider.tsx @@ -58,6 +58,7 @@ import { ExitFullscreenIcon, FullscreenIcon } from '../features/call/Controls'; import { useTheme, ThemeKind } from '../hooks/useTheme'; import { useReducedMotion } from '../hooks/useReducedMotion'; import { useSetting } from '../state/hooks/settings'; +import { useCallPreferences } from '../state/hooks/callPreferences'; import { settingsAtom } from '../state/settings'; import { getStateEvent, getStateEvents, getMemberName } from '../utils/room'; import { StateEvent } from '../../types/matrix/room'; @@ -410,6 +411,8 @@ function IncomingCallListener({ callEmbed, joined }: IncomingCallListenerProps) const [callInfo, setCallInfo] = useState(); const dm = callInfo ? directs.has(callInfo.room.roomId) : false; const startCall = useCallStart(dm); + const { microphone, sound } = useCallPreferences(); + const [cameraOnJoin] = useSetting(settingsAtom, 'cameraOnJoin'); // C-L6: handleTimelineEvent awaits decryption before calling setState; guard // against the component unmounting during that await. @@ -566,11 +569,15 @@ function IncomingCallListener({ callEmbed, joined }: IncomingCallListenerProps) const handleAnswer = useCallback( (room: Room, video: boolean) => { - startCall(room, { microphone: true, video, sound: true }); + // Honour cameraOnJoin and the persisted mic/sound preferences instead of + // forcing camera+mic+sound on — every other join path does this, and + // Answer was skipping it, publishing the camera with no prescreen. + // (PTT's forceAudioOff is applied downstream inside useCallStart.) + startCall(room, { microphone, video: cameraOnJoin && video, sound }); setCallInfo(undefined); navigateRoom(room.roomId); }, - [startCall, navigateRoom], + [startCall, navigateRoom, microphone, sound, cameraOnJoin], ); if (!callInfo) return null;