From 53b3d6fe98f5d3e31ccc93a57a0eefb4378f45b1 Mon Sep 17 00:00:00 2001 From: Timo <16718859+toger5@users.noreply.github.com> Date: Fri, 2 Feb 2024 12:35:50 +0100 Subject: [PATCH] Fix sending call notify (#12211) Signed-off-by: Timo K --- src/models/Call.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/models/Call.ts b/src/models/Call.ts index aafbadb8c8..10af51ec54 100644 --- a/src/models/Call.ts +++ b/src/models/Call.ts @@ -850,13 +850,17 @@ export class ElementCall extends Call { protected async sendCallNotify(): Promise { const room = this.room; - const existingRoomCallMembers = MatrixRTCSession.callMembershipsForRoom(room).filter( + const existingOtherRoomCallMembers = MatrixRTCSession.callMembershipsForRoom(room).filter( // filter all memberships where the application is m.call and the call_id is "" - (m) => m.application === "m.call" && m.callId === "", + (m) => { + const isRoomCallMember = m.application === "m.call" && m.callId === ""; + const isThisDevice = m.deviceId === this.client.deviceId; + return isRoomCallMember && !isThisDevice; + }, ); const memberCount = getJoinedNonFunctionalMembers(room).length; - if (!isVideoRoom(room) && existingRoomCallMembers.length == 0) { + if (!isVideoRoom(room) && existingOtherRoomCallMembers.length === 0) { // send ringing event const content: ICallNotifyContent = { "application": "m.call",