From 302d4bc02d426f2cebc8e3091e5ac7a1354163b9 Mon Sep 17 00:00:00 2001 From: Bruno Windels <274386+bwindels@users.noreply.github.com> Date: Mon, 11 Apr 2022 13:39:18 +0200 Subject: [PATCH] use session id from member event, and also send it for other party --- src/matrix/calls/group/GroupCall.ts | 1 + src/matrix/calls/group/Member.ts | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/matrix/calls/group/GroupCall.ts b/src/matrix/calls/group/GroupCall.ts index 3a28c9a7..886cb53a 100644 --- a/src/matrix/calls/group/GroupCall.ts +++ b/src/matrix/calls/group/GroupCall.ts @@ -330,6 +330,7 @@ export class GroupCall extends EventEmitter<{change: never}> { if (!deviceInfo) { deviceInfo = { ["device_id"]: this.options.ownDeviceId, + ["session_id"]: this.options.sessionId, feeds: [{purpose: "m.usermedia"}] }; devicesInfo.push(deviceInfo); diff --git a/src/matrix/calls/group/Member.ts b/src/matrix/calls/group/Member.ts index 2929e26c..4086d060 100644 --- a/src/matrix/calls/group/Member.ts +++ b/src/matrix/calls/group/Member.ts @@ -138,6 +138,11 @@ export class Member { /** @internal */ handleDeviceMessage(message: SignallingMessage, deviceId: string, syncLog: ILogItem) { syncLog.refDetached(this.logItem); + const destSessionId = message.content.dest_session_id; + if (destSessionId !== this.options.sessionId) { + this.logItem.log({l: "ignoring to_device event with wrong session_id", destSessionId, type: message.type}); + return; + } if (message.type === EventType.Invite && !this.peerCall) { this.peerCall = this._createPeerCall(message.content.call_id); }