1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-12-20 22:21:59 +03:00

fixup: RTC experimental todevice should use new encryption mgr

This commit is contained in:
Valere
2025-04-17 15:12:50 +02:00
parent 8ad79efa4e
commit ec4c46652e
2 changed files with 4 additions and 11 deletions

View File

@@ -21,6 +21,7 @@ import { MatrixRTCSession, MatrixRTCSessionEvent } from "../../../src/matrixrtc/
import { type EncryptionKeysEventContent } from "../../../src/matrixrtc/types"; import { type EncryptionKeysEventContent } from "../../../src/matrixrtc/types";
import { secureRandomString } from "../../../src/randomstring"; import { secureRandomString } from "../../../src/randomstring";
import { makeMockEvent, makeMockRoom, makeMockRoomState, membershipTemplate, makeKey } from "./mocks"; import { makeMockEvent, makeMockRoom, makeMockRoomState, membershipTemplate, makeKey } from "./mocks";
import { RTCEncryptionManager } from "../../../src/matrixrtc/RTCEncryptionManager.ts";
const mockFocus = { type: "mock" }; const mockFocus = { type: "mock" };
@@ -1016,6 +1017,9 @@ describe("MatrixRTCSession", () => {
await keySentPromise; await keySentPromise;
expect(sendToDeviceMock).toHaveBeenCalled(); expect(sendToDeviceMock).toHaveBeenCalled();
// Access private to test
expect(sess["encryptionManager"]).toBeInstanceOf(RTCEncryptionManager);
} finally { } finally {
jest.useRealTimers(); jest.useRealTimers();
} }

View File

@@ -443,17 +443,6 @@ export class MatrixRTCSession extends TypedEventEmitter<
}, },
); );
} }
this.encryptionManager = new EncryptionManager(
this.client.getUserId()!,
this.client.getDeviceId()!,
() => this.memberships,
transport,
this.statistics,
(keyBin: Uint8Array<ArrayBufferLike>, encryptionKeyIndex: number, participantId: string) => {
this.emit(MatrixRTCSessionEvent.EncryptionKeyChanged, keyBin, encryptionKeyIndex, participantId);
},
this.logger,
);
} }
// Join! // Join!