From e3ab4ca4b875dfd8c3406db04abede65c8e17a65 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 9 Jun 2022 22:01:20 +0100 Subject: [PATCH 1/2] Emit unknown device errors for group call participants without e2e There are a number of different cases here: there were some before when dealing with versions that didn't send deviceId. This catches all of them and makes all these cases emit the same error. --- src/webrtc/call.ts | 3 ++- src/webrtc/callEventHandler.ts | 18 +++++++++++------- src/webrtc/groupCall.ts | 31 +++++++++++++++++++------------ 3 files changed, 32 insertions(+), 20 deletions(-) diff --git a/src/webrtc/call.ts b/src/webrtc/call.ts index 8c736b252bc..bcc1de17fd3 100644 --- a/src/webrtc/call.ts +++ b/src/webrtc/call.ts @@ -48,6 +48,7 @@ import { MatrixClient } from "../client"; import { ISendEventResponse } from "../@types/requests"; import { EventEmitterEvents, TypedEventEmitter } from "../models/typed-event-emitter"; import { DeviceInfo } from '../crypto/deviceinfo'; +import { GroupCallUnknownDeviceError } from './groupCall'; // events: hangup, error(err), replaced(call), state(state, oldState) @@ -521,7 +522,7 @@ export class MatrixCall extends TypedEventEmitter Date: Fri, 10 Jun 2022 11:47:24 +0100 Subject: [PATCH 2/2] Add type --- src/webrtc/callEventHandler.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/webrtc/callEventHandler.ts b/src/webrtc/callEventHandler.ts index 43d40865798..33235d48ef2 100644 --- a/src/webrtc/callEventHandler.ts +++ b/src/webrtc/callEventHandler.ts @@ -20,7 +20,7 @@ import { CallDirection, CallErrorCode, CallState, createNewMatrixCall, MatrixCal import { EventType } from '../@types/event'; import { ClientEvent, MatrixClient } from '../client'; import { MCallAnswer, MCallHangupReject } from "./callEventTypes"; -import { GroupCallErrorCode, GroupCallEvent, GroupCallUnknownDeviceError } from './groupCall'; +import { GroupCall, GroupCallErrorCode, GroupCallEvent, GroupCallUnknownDeviceError } from './groupCall'; import { RoomEvent } from "../models/room"; // Don't ring unless we'd be ringing for at least 3 seconds: the user needs some @@ -210,7 +210,7 @@ export class CallEventHandler { let opponentDeviceId: string | undefined; - let groupCall; + let groupCall: GroupCall; if (groupCallId) { groupCall = this.client.groupCallEventHandler.getGroupCallById(groupCallId);