Skip to content

Commit

Permalink
Show unencrypted media warnings in widget mode (#1915)
Browse files Browse the repository at this point in the history
They weren't showing up because the video tiles didn't think that the call was encrypted in the per-participant keys case.
  • Loading branch information
robintown authored Nov 23, 2023
1 parent d328fc2 commit 115dfea
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/room/GroupCallView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@ export const GroupCallView: FC<Props> = ({
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 () => {
Expand All @@ -89,8 +86,10 @@ export const GroupCallView: FC<Props> = ({
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 {
Expand Down Expand Up @@ -289,7 +288,7 @@ export const GroupCallView: FC<Props> = ({

const { t } = useTranslation();

if (isRoomE2EE && !perParticipantE2EE && !e2eeSharedKey) {
if (roomEncrypted && !perParticipantE2EE && !e2eeSharedKey) {
return (
<ErrorView
error={
Expand All @@ -299,7 +298,7 @@ export const GroupCallView: FC<Props> = ({
}
/>
);
} else if (!isE2EESupported() && isRoomE2EE) {
} else if (!isE2EESupported() && roomEncrypted) {
return (
<FullScreenView>
<Heading>{t("browser_media_e2ee_unsupported_heading")}</Heading>
Expand Down

0 comments on commit 115dfea

Please sign in to comment.