@@ -48,7 +48,6 @@ import {
48
48
import { CallFeed } from "./callFeed.ts" ;
49
49
import { MatrixClient } from "../client.ts" ;
50
50
import { EventEmitterEvents , TypedEventEmitter } from "../models/typed-event-emitter.ts" ;
51
- import { DeviceInfo } from "../crypto/deviceinfo.ts" ;
52
51
import { GroupCallUnknownDeviceError } from "./groupCall.ts" ;
53
52
import { IScreensharingOpts } from "./mediaHandler.ts" ;
54
53
import { MatrixError } from "../http-api/index.ts" ;
@@ -426,7 +425,7 @@ export class MatrixCall extends TypedEventEmitter<CallEvent, CallEventHandlerMap
426
425
private callStartTime ?: number ;
427
426
428
427
private opponentDeviceId ?: string ;
429
- private opponentDeviceInfo ?: DeviceInfo ;
428
+ private hasOpponentDeviceInfo ?: boolean ;
430
429
private opponentSessionId ?: string ;
431
430
public groupCallId ?: string ;
432
431
@@ -633,19 +632,16 @@ export class MatrixCall extends TypedEventEmitter<CallEvent, CallEventHandlerMap
633
632
// ourselves (for example if the client is a RoomWidgetClient)
634
633
if ( ! this . client . getCrypto ( ) ) {
635
634
// All we know is the device ID
636
- this . opponentDeviceInfo = new DeviceInfo ( this . opponentDeviceId ) ;
635
+ this . hasOpponentDeviceInfo = true ;
637
636
return ;
638
637
}
639
638
const userId = this . invitee || this . getOpponentMember ( ) ?. userId ;
640
639
641
640
if ( ! userId ) throw new Error ( "Couldn't find opponent user ID to init crypto" ) ;
642
641
643
642
// Here we were calling `MatrixClient.crypto.deviceList.downloadKeys` which is not supported by the rust cryptography.
644
- const deviceInfoMap = new Map ( ) ;
645
- this . opponentDeviceInfo = deviceInfoMap . get ( userId ) ?. get ( this . opponentDeviceId ) ;
646
- if ( this . opponentDeviceInfo === undefined ) {
647
- throw new GroupCallUnknownDeviceError ( userId ) ;
648
- }
643
+ this . hasOpponentDeviceInfo = false ;
644
+ throw new GroupCallUnknownDeviceError ( userId ) ;
649
645
}
650
646
651
647
/**
@@ -2509,7 +2505,7 @@ export class MatrixCall extends TypedEventEmitter<CallEvent, CallEventHandlerMap
2509
2505
2510
2506
const userId = this . invitee || this . getOpponentMember ( ) ! . userId ;
2511
2507
if ( this . client . getUseE2eForGroupCall ( ) ) {
2512
- if ( ! this . opponentDeviceInfo ) {
2508
+ if ( ! this . hasOpponentDeviceInfo ) {
2513
2509
logger . warn ( `Call ${ this . callId } sendVoipEvent() failed: we do not have opponentDeviceInfo` ) ;
2514
2510
return ;
2515
2511
}
0 commit comments