From 115dfea5215a245985668823cff0eb2f44705bd7 Mon Sep 17 00:00:00 2001 From: Robin Date: Thu, 23 Nov 2023 11:50:55 -0500 Subject: [PATCH] Show unencrypted media warnings in widget mode (#1915) They weren't showing up because the video tiles didn't think that the call was encrypted in the per-participant keys case. --- src/room/GroupCallView.tsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/room/GroupCallView.tsx b/src/room/GroupCallView.tsx index 1ccb30d6e..e1e2055bd 100644 --- a/src/room/GroupCallView.tsx +++ b/src/room/GroupCallView.tsx @@ -76,9 +76,6 @@ export const GroupCallView: FC = ({ const memberships = useMatrixRTCSessionMemberships(rtcSession); const isJoined = useMatrixRTCSessionJoinState(rtcSession); - const e2eeSharedKey = useRoomSharedKey(rtcSession.room.roomId); - const isRoomE2EE = useIsRoomE2EE(rtcSession.room.roomId); - useEffect(() => { window.rtcSession = rtcSession; return () => { @@ -89,8 +86,10 @@ export const GroupCallView: FC = ({ const { displayName, avatarUrl } = useProfile(client); const roomName = useRoomName(rtcSession.room); const roomAvatar = useRoomAvatar(rtcSession.room); - const roomEncrypted = useIsRoomE2EE(rtcSession.room.roomId)!; + const e2eeSharedKey = useRoomSharedKey(rtcSession.room.roomId); const { perParticipantE2EE } = useUrlParams(); + const roomEncrypted = + useIsRoomE2EE(rtcSession.room.roomId) || perParticipantE2EE; const matrixInfo = useMemo((): MatrixInfo => { return { @@ -289,7 +288,7 @@ export const GroupCallView: FC = ({ const { t } = useTranslation(); - if (isRoomE2EE && !perParticipantE2EE && !e2eeSharedKey) { + if (roomEncrypted && !perParticipantE2EE && !e2eeSharedKey) { return ( = ({ } /> ); - } else if (!isE2EESupported() && isRoomE2EE) { + } else if (!isE2EESupported() && roomEncrypted) { return ( {t("browser_media_e2ee_unsupported_heading")}