Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Check if the user is already connected to the call.
Browse files Browse the repository at this point in the history
  • Loading branch information
toger5 committed Jul 9, 2024
1 parent cd39d91 commit 13404e5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Notifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 13404e5

Please sign in to comment.