mirror of
https://github.com/vector-im/element-call.git
synced 2026-08-29 21:15:19 +00:00
@@ -38,27 +38,32 @@ export class MatrixKeyProvider extends BaseKeyProvider {
|
|||||||
this.onEncryptionKeyChanged
|
this.onEncryptionKeyChanged
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// The new session could be aware of keys of which the old session wasn't,
|
||||||
|
// so emit a key changed event.
|
||||||
for (const [
|
for (const [
|
||||||
participant,
|
participant,
|
||||||
encryptionKey,
|
encryptionKeys,
|
||||||
] of this.rtcSession.getEncryptionKeys()) {
|
] of this.rtcSession.getEncryptionKeys()) {
|
||||||
// The new session could be aware of keys of which the old session wasn't,
|
for (const [index, encryptionKey] of encryptionKeys.entries()) {
|
||||||
// so emit a key changed event.
|
this.onEncryptionKeyChanged(encryptionKey, index, participant);
|
||||||
this.onEncryptionKeyChanged(encryptionKey, participant);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private onEncryptionKeyChanged = async (
|
private onEncryptionKeyChanged = async (
|
||||||
encryptionKey: string,
|
encryptionKey: string,
|
||||||
|
encryptionKeyIndex: number,
|
||||||
participantId: string
|
participantId: string
|
||||||
) => {
|
) => {
|
||||||
console.log(
|
|
||||||
`Embedded-E2EE-LOG onEncryptionKeyChanged participantId=${participantId} encryptionKey=${encryptionKey}`
|
|
||||||
);
|
|
||||||
|
|
||||||
this.onSetEncryptionKey(
|
this.onSetEncryptionKey(
|
||||||
await createKeyMaterialFromString(encryptionKey),
|
await createKeyMaterialFromString(encryptionKey),
|
||||||
participantId
|
participantId,
|
||||||
|
encryptionKeyIndex
|
||||||
|
);
|
||||||
|
|
||||||
|
console.log(
|
||||||
|
`Embedded-E2EE-LOG onEncryptionKeyChanged participantId=${participantId} encryptionKeyIndex=${encryptionKeyIndex} encryptionKey=${encryptionKey}`,
|
||||||
|
this.getKeys()
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -176,12 +176,10 @@ export function InCallView({
|
|||||||
|
|
||||||
const toggleMicrophone = useCallback(() => {
|
const toggleMicrophone = useCallback(() => {
|
||||||
muteStates.audio.setEnabled?.((e) => !e);
|
muteStates.audio.setEnabled?.((e) => !e);
|
||||||
rtcSession.updateEncryptionKeyEvent();
|
}, [muteStates]);
|
||||||
}, [muteStates, rtcSession]);
|
|
||||||
const toggleCamera = useCallback(() => {
|
const toggleCamera = useCallback(() => {
|
||||||
muteStates.video.setEnabled?.((e) => !e);
|
muteStates.video.setEnabled?.((e) => !e);
|
||||||
rtcSession.updateEncryptionKeyEvent();
|
}, [muteStates]);
|
||||||
}, [muteStates, rtcSession]);
|
|
||||||
|
|
||||||
const joinRule = useJoinRule(rtcSession.room);
|
const joinRule = useJoinRule(rtcSession.room);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user