Skip to content

Commit ec4c466

Browse files
committed
fixup: RTC experimental todevice should use new encryption mgr
1 parent 8ad79ef commit ec4c466

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

spec/unit/matrixrtc/MatrixRTCSession.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { MatrixRTCSession, MatrixRTCSessionEvent } from "../../../src/matrixrtc/
2121
import { type EncryptionKeysEventContent } from "../../../src/matrixrtc/types";
2222
import { secureRandomString } from "../../../src/randomstring";
2323
import { makeMockEvent, makeMockRoom, makeMockRoomState, membershipTemplate, makeKey } from "./mocks";
24+
import { RTCEncryptionManager } from "../../../src/matrixrtc/RTCEncryptionManager.ts";
2425

2526
const mockFocus = { type: "mock" };
2627

@@ -1016,6 +1017,9 @@ describe("MatrixRTCSession", () => {
10161017
await keySentPromise;
10171018

10181019
expect(sendToDeviceMock).toHaveBeenCalled();
1020+
1021+
// Access private to test
1022+
expect(sess["encryptionManager"]).toBeInstanceOf(RTCEncryptionManager);
10191023
} finally {
10201024
jest.useRealTimers();
10211025
}

src/matrixrtc/MatrixRTCSession.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -443,17 +443,6 @@ export class MatrixRTCSession extends TypedEventEmitter<
443443
},
444444
);
445445
}
446-
this.encryptionManager = new EncryptionManager(
447-
this.client.getUserId()!,
448-
this.client.getDeviceId()!,
449-
() => this.memberships,
450-
transport,
451-
this.statistics,
452-
(keyBin: Uint8Array<ArrayBufferLike>, encryptionKeyIndex: number, participantId: string) => {
453-
this.emit(MatrixRTCSessionEvent.EncryptionKeyChanged, keyBin, encryptionKeyIndex, participantId);
454-
},
455-
this.logger,
456-
);
457446
}
458447

459448
// Join!

0 commit comments

Comments
 (0)