From 13404e5449fe35506bda3049ddfbe04fabf6ecb3 Mon Sep 17 00:00:00 2001 From: Timo Date: Tue, 9 Jul 2024 13:09:58 +0200 Subject: [PATCH] Check if the user is already connected to the call. --- src/Notifier.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Notifier.ts b/src/Notifier.ts index fbe3add75b82..5e09ee6503e7 100644 --- a/src/Notifier.ts +++ b/src/Notifier.ts @@ -59,6 +59,8 @@ import { VoiceBroadcastChunkEventType, VoiceBroadcastInfoEventType } from "./voi import { getSenderName } from "./utils/event/getSenderName"; import { stripPlainReply } from "./utils/Reply"; import { BackgroundAudio } from "./audio/BackgroundAudio"; +import { CallStore } from "./stores/CallStore"; +import { ElementCall } from "./models/Call"; /* * Dispatches: @@ -508,7 +510,13 @@ class NotifierClass { if ( EventType.CallNotify === ev.getType() && SettingsStore.getValue("feature_group_calls") && - (ev.getAge() ?? 0) < 10000 + (ev.getAge() ?? 0) < 10000 && + !Array.from(CallStore.instance.connectedCalls).some( + (call) => + call instanceof ElementCall && + call.roomId === ev.getRoomId() && + call.session.callId === ev.getContent().call_id, + ) ) { const content = ev.getContent(); const roomId = ev.getRoomId();