@@ -49,10 +49,10 @@ import { CallFeed } from "./callFeed.ts";
49
49
import { MatrixClient } from "../client.ts" ;
50
50
import { EventEmitterEvents , TypedEventEmitter } from "../models/typed-event-emitter.ts" ;
51
51
import { DeviceInfo } from "../crypto/deviceinfo.ts" ;
52
- import { GroupCallUnknownDeviceError } from "./groupCall.ts" ;
53
52
import { IScreensharingOpts } from "./mediaHandler.ts" ;
54
53
import { MatrixError } from "../http-api/index.ts" ;
55
54
import { GroupCallStats } from "./stats/groupCallStats.ts" ;
55
+ import { GroupCallUnknownDeviceError } from "./groupCall.ts" ;
56
56
57
57
interface CallOpts {
58
58
// The room ID for this call.
@@ -631,19 +631,17 @@ export class MatrixCall extends TypedEventEmitter<CallEvent, CallEventHandlerMap
631
631
if ( ! this . client . getUseE2eForGroupCall ( ) ) return ;
632
632
// It's possible to want E2EE and yet not have the means to manage E2EE
633
633
// ourselves (for example if the client is a RoomWidgetClient)
634
- if ( ! this . client . isCryptoEnabled ( ) ) {
634
+ if ( ! this . client . getCrypto ( ) ) {
635
635
// All we know is the device ID
636
636
this . opponentDeviceInfo = new DeviceInfo ( this . opponentDeviceId ) ;
637
637
return ;
638
638
}
639
- // if we've got to this point, we do want to init crypto, so throw if we can't
640
- if ( ! this . client . crypto ) throw new Error ( "Crypto is not initialised." ) ;
641
-
642
639
const userId = this . invitee || this . getOpponentMember ( ) ?. userId ;
643
640
644
641
if ( ! userId ) throw new Error ( "Couldn't find opponent user ID to init crypto" ) ;
645
642
646
- const deviceInfoMap = await this . client . crypto . deviceList . downloadKeys ( [ userId ] , false ) ;
643
+ // Here we were calling `MatrixClient.crypto.deviceList.downloadKeys` which is not supported by the rust cryptography.
644
+ const deviceInfoMap = new Map ( ) ;
647
645
this . opponentDeviceInfo = deviceInfoMap . get ( userId ) ?. get ( this . opponentDeviceId ) ;
648
646
if ( this . opponentDeviceInfo === undefined ) {
649
647
throw new GroupCallUnknownDeviceError ( userId ) ;
@@ -2516,18 +2514,7 @@ export class MatrixCall extends TypedEventEmitter<CallEvent, CallEventHandlerMap
2516
2514
return ;
2517
2515
}
2518
2516
2519
- await this . client . encryptAndSendToDevices (
2520
- [
2521
- {
2522
- userId,
2523
- deviceInfo : this . opponentDeviceInfo ,
2524
- } ,
2525
- ] ,
2526
- {
2527
- type : eventType ,
2528
- content,
2529
- } ,
2530
- ) ;
2517
+ // Here we were calling `MatrixClient.encryptAndSendToDevices` which is not supported by the rust cryptography.
2531
2518
} else {
2532
2519
await this . client . sendToDevice (
2533
2520
eventType ,
@@ -2869,7 +2856,8 @@ export class MatrixCall extends TypedEventEmitter<CallEvent, CallEventHandlerMap
2869
2856
this . checkForErrorListener ( ) ;
2870
2857
this . direction = CallDirection . Outbound ;
2871
2858
2872
- await this . initOpponentCrypto ( ) ;
2859
+ // Here we were initializing the opponent crypto
2860
+ // It was removed because it was calling deprecated methods which were not working since the rust crypto migration.
2873
2861
2874
2862
// XXX Find a better way to do this
2875
2863
this . client . callEventHandler ! . calls . set ( this . callId , this ) ;
0 commit comments