fix: exclude acting user from federated call end/reject broadcast

sendToFederatedCallUsers sent dm_call_ended/rejected back to the user
who initiated the action. They already disconnected in their click
handler — the redundant event triggered disconnectFn() again, causing
connect and disconnect sounds to play simultaneously.

Added excludeUserId parameter to sendToFederatedCallUsers, used in
handleDmCallEnd and handleDmCallReject Path 2.
This commit is contained in:
Jannis Braun
2026-04-08 14:49:29 +02:00
parent 9e7e068df7
commit 5b1c847e57
2 changed files with 9 additions and 4 deletions
+4 -2
View File
@@ -758,11 +758,13 @@ class ConnectionManager {
* ALWAYS uses ringedUserIds, never sendToDmMembers — sendToDmMembers would
* also reach the caller's replicated stub, causing cross-instance event contamination
* (the caller's multi-instance WS gets dm_call_accepted with the wrong dmChannelId). */
sendToFederatedCallUsers(federatedId: string, event: ServerEvent): void {
sendToFederatedCallUsers(federatedId: string, event: ServerEvent, excludeUserId?: string): void {
const call = this.federatedCalls.get(federatedId);
if (!call) return;
for (const uid of call.ringedUserIds) {
this.sendToUser(uid, event);
if (uid !== excludeUserId) {
this.sendToUser(uid, event);
}
}
}