1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-25 05:23:13 +03:00

Don't rotate keys if not managing media keys (#3877)

This could have caused weirdness in non per-user key calling mode.
This commit is contained in:
David Baker
2023-11-15 14:44:58 +00:00
committed by GitHub
parent 10cd84a653
commit c6e6248cd6

View File

@@ -578,7 +578,7 @@ export class MatrixRTCSession extends TypedEventEmitter<MatrixRTCSessionEvent, M
const isMyMembership = (m: CallMembership): boolean => const isMyMembership = (m: CallMembership): boolean =>
m.sender === this.client.getUserId() && m.deviceId === this.client.getDeviceId(); m.sender === this.client.getUserId() && m.deviceId === this.client.getDeviceId();
if (this.isJoined() && this.makeNewKeyTimeout === undefined) { if (this.manageMediaKeys && this.isJoined() && this.makeNewKeyTimeout === undefined) {
const oldMebershipIds = new Set( const oldMebershipIds = new Set(
oldMemberships.filter((m) => !isMyMembership(m)).map(getParticipantIdFromMembership), oldMemberships.filter((m) => !isMyMembership(m)).map(getParticipantIdFromMembership),
); );
@@ -782,6 +782,8 @@ export class MatrixRTCSession extends TypedEventEmitter<MatrixRTCSessionEvent, M
} }
private onRotateKeyTimeout = (): void => { private onRotateKeyTimeout = (): void => {
if (!this.manageMediaKeys) return;
this.makeNewKeyTimeout = undefined; this.makeNewKeyTimeout = undefined;
logger.info("Making new sender key for key rotation"); logger.info("Making new sender key for key rotation");
this.makeNewSenderKey(true); this.makeNewSenderKey(true);