From b5208ffeae1c409eb1b99a6da075b25776b54fea Mon Sep 17 00:00:00 2001 From: Timo Date: Tue, 5 Nov 2024 12:55:48 +0100 Subject: [PATCH] tests --- src/state/CallViewModel.ts | 5 ----- src/state/MediaViewModel.ts | 21 ++------------------- src/utils/test.ts | 5 ----- 3 files changed, 2 insertions(+), 29 deletions(-) diff --git a/src/state/CallViewModel.ts b/src/state/CallViewModel.ts index a3455af8..1d709df5 100644 --- a/src/state/CallViewModel.ts +++ b/src/state/CallViewModel.ts @@ -176,7 +176,6 @@ class UserMedia { member: RoomMember | undefined, participant: LocalParticipant | RemoteParticipant | undefined, encryptionSystem: EncryptionSystem, - rtcSession: MatrixRTCSession, ) { this.participant = new BehaviorSubject(participant); @@ -186,7 +185,6 @@ class UserMedia { member, this.participant.asObservable() as Observable, encryptionSystem, - rtcSession, ); } else { this.vm = new RemoteUserMediaViewModel( @@ -196,7 +194,6 @@ class UserMedia { RemoteParticipant | undefined >, encryptionSystem, - rtcSession, ); } @@ -440,7 +437,6 @@ export class CallViewModel extends ViewModel { member, participant, this.encryptionSystem, - this.matrixRTCSession, ), ]; } @@ -494,7 +490,6 @@ export class CallViewModel extends ViewModel { undefined, participant, this.encryptionSystem, - this.matrixRTCSession, ), ]; } diff --git a/src/state/MediaViewModel.ts b/src/state/MediaViewModel.ts index 32953651..31d0dcc7 100644 --- a/src/state/MediaViewModel.ts +++ b/src/state/MediaViewModel.ts @@ -37,7 +37,6 @@ import { switchMap, } from "rxjs"; import { useEffect } from "react"; -import { MatrixRTCSession } from "matrix-js-sdk/src/matrixrtc"; import { ViewModel } from "./ViewModel"; import { useReactiveState } from "../useReactiveState"; @@ -206,7 +205,6 @@ abstract class BaseUserMediaViewModel extends BaseMediaViewModel { member: RoomMember | undefined, participant: Observable, encryptionSystem: EncryptionSystem, - rtcSession: MatrixRTCSession, ) { super( id, @@ -217,19 +215,6 @@ abstract class BaseUserMediaViewModel extends BaseMediaViewModel { Track.Source.Camera, ); - // rtcSession.on( - // MatrixRTCSessionEvent.EncryptionKeyChanged, - // (key, index, participantId) => { - // if (id.startsWith(participantId)) - // logger.info("got new keys: ", participant, { index, key }); - // logger.info("All keys for participant ", participant, " - ", [ - // ...this.keys.value, - // { index, key }, - // ]); - // this.keys.next([...this.keys.value, { index, key }]); - // }, - // ); - const media = participant.pipe( switchMap((p) => (p && observeParticipantMedia(p)) ?? of(undefined)), this.scope.state(), @@ -280,9 +265,8 @@ export class LocalUserMediaViewModel extends BaseUserMediaViewModel { member: RoomMember | undefined, participant: Observable, encryptionSystem: EncryptionSystem, - rtcSession: MatrixRTCSession, ) { - super(id, member, participant, encryptionSystem, rtcSession); + super(id, member, participant, encryptionSystem); } } @@ -341,9 +325,8 @@ export class RemoteUserMediaViewModel extends BaseUserMediaViewModel { member: RoomMember | undefined, participant: Observable, encryptionSystem: EncryptionSystem, - rtcSession: MatrixRTCSession, ) { - super(id, member, participant, encryptionSystem, rtcSession); + super(id, member, participant, encryptionSystem); // Sync the local volume with LiveKit combineLatest([ diff --git a/src/utils/test.ts b/src/utils/test.ts index dbe3cb46..d2014afb 100644 --- a/src/utils/test.ts +++ b/src/utils/test.ts @@ -15,7 +15,6 @@ import { RemoteTrackPublication, Room as LivekitRoom, } from "livekit-client"; -import { MatrixRTCSession } from "matrix-js-sdk/src/matrixrtc"; import { LocalUserMediaViewModel, @@ -118,7 +117,6 @@ export function mockLocalParticipant( export async function withLocalMedia( member: Partial, - rtcSession: MatrixRTCSession, continuation: (vm: LocalUserMediaViewModel) => void | Promise, ): Promise { const vm = new LocalUserMediaViewModel( @@ -128,7 +126,6 @@ export async function withLocalMedia( { kind: E2eeType.PER_PARTICIPANT, }, - rtcSession, ); try { await continuation(vm); @@ -153,7 +150,6 @@ export function mockRemoteParticipant( export async function withRemoteMedia( member: Partial, participant: Partial, - rtcSession: MatrixRTCSession, continuation: (vm: RemoteUserMediaViewModel) => void | Promise, ): Promise { const vm = new RemoteUserMediaViewModel( @@ -163,7 +159,6 @@ export async function withRemoteMedia( { kind: E2eeType.PER_PARTICIPANT, }, - rtcSession, ); try { await continuation(vm);