You've already forked matrix-js-sdk
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:
@@ -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();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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!
|
||||||
|
|||||||
Reference in New Issue
Block a user