Skip to content

Commit a45de2f

Browse files
committed
Remove deprecated calls in webrtc/call.ts
1 parent 3781b6e commit a45de2f

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

src/webrtc/call.ts

+4-17
Original file line numberDiff line numberDiff line change
@@ -631,19 +631,17 @@ export class MatrixCall extends TypedEventEmitter<CallEvent, CallEventHandlerMap
631631
if (!this.client.getUseE2eForGroupCall()) return;
632632
// It's possible to want E2EE and yet not have the means to manage E2EE
633633
// ourselves (for example if the client is a RoomWidgetClient)
634-
if (!this.client.isCryptoEnabled()) {
634+
if (!this.client.getCrypto()) {
635635
// All we know is the device ID
636636
this.opponentDeviceInfo = new DeviceInfo(this.opponentDeviceId);
637637
return;
638638
}
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-
642639
const userId = this.invitee || this.getOpponentMember()?.userId;
643640

644641
if (!userId) throw new Error("Couldn't find opponent user ID to init crypto");
645642

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();
647645
this.opponentDeviceInfo = deviceInfoMap.get(userId)?.get(this.opponentDeviceId);
648646
if (this.opponentDeviceInfo === undefined) {
649647
throw new GroupCallUnknownDeviceError(userId);
@@ -2516,18 +2514,7 @@ export class MatrixCall extends TypedEventEmitter<CallEvent, CallEventHandlerMap
25162514
return;
25172515
}
25182516

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.
25312518
} else {
25322519
await this.client.sendToDevice(
25332520
eventType,

0 commit comments

Comments
 (0)