diff --git a/package-lock.json b/package-lock.json index 94bbe8279..67205ea29 100644 --- a/package-lock.json +++ b/package-lock.json @@ -81,7 +81,7 @@ }, "devDependencies": { "@axe-core/playwright": "4.13.0", - "@lotusguild/element-call-embedded": "0.25.0-lotus.22", + "@lotusguild/element-call-embedded": "0.25.0-lotus.23", "@playwright/test": "1.63.0", "@rollup/plugin-inject": "5.0.5", "@rollup/plugin-wasm": "6.2.2", @@ -2695,9 +2695,9 @@ "integrity": "sha512-dfLbk+PwWvFzSxwk3n5ySL0hfBog779o8h68wK/7/APo/7cgyWp5jcXockbxdk5kFRkbeXWm4Fbi9FrdN381sA==" }, "node_modules/@lotusguild/element-call-embedded": { - "version": "0.25.0-lotus.22", - "resolved": "https://code.lotusguild.org/api/packages/LotusGuild/npm/%40lotusguild%2Felement-call-embedded/-/0.25.0-lotus.22/element-call-embedded-0.25.0-lotus.22.tgz", - "integrity": "sha512-AimDKZA4xUKEEyl2XUFUSUDl03tBKFv88T/3igKyH2VqNSPMGnqcQJC5HXIkHLTWrOmg8kLcJ//FFbqlUZiLcA==", + "version": "0.25.0-lotus.23", + "resolved": "https://code.lotusguild.org/api/packages/LotusGuild/npm/%40lotusguild%2Felement-call-embedded/-/0.25.0-lotus.23/element-call-embedded-0.25.0-lotus.23.tgz", + "integrity": "sha512-vRmcWeJcU0Accyl2x3mqNEzrIe8djE5BekyYbYOSCsMflC98rZgD1mO7KOe7bA1cX7gparRf6sAt1fotHoU+bA==", "dev": true }, "node_modules/@matrix-org/matrix-sdk-crypto-wasm": { diff --git a/package.json b/package.json index 45cc95b97..4bfab9a41 100644 --- a/package.json +++ b/package.json @@ -108,7 +108,7 @@ }, "devDependencies": { "@axe-core/playwright": "4.13.0", - "@lotusguild/element-call-embedded": "0.25.0-lotus.22", + "@lotusguild/element-call-embedded": "0.25.0-lotus.23", "@playwright/test": "1.63.0", "@rollup/plugin-inject": "5.0.5", "@rollup/plugin-wasm": "6.2.2", diff --git a/src/app/plugins/call/CallEmbed.ts b/src/app/plugins/call/CallEmbed.ts index 039b024b1..0ef609645 100644 --- a/src/app/plugins/call/CallEmbed.ts +++ b/src/app/plugins/call/CallEmbed.ts @@ -31,6 +31,7 @@ import { verifyDenoiseAssets } from './denoiseSmokeCheck'; import { canDelegateCapability } from './utils'; import { getCallPageUrl } from './callPageUrl'; import { restrictWidgetMessages } from '../widgetTransport'; +import { isRingableRoom } from '../../utils/callRing'; // Maximum time to wait for the embedded Element Call iframe to progress from // initial load to a ready/joined state. If it hasn't by then, we assume the @@ -251,8 +252,18 @@ export class CallEmbed { verifyDenoiseAssets(denoiseModel).catch(() => undefined); } + // [Gitea #295] Only ask Element Call to notify where a call can ring at all + // (DMs, invite-only groups outside a space). In a voice channel or space + // room the notification carries an @room mention, so every member got a + // highlighted ping (and phone push) whenever a moderator hopped in, and + // other clients showed it as a missed call. + // `none` needs element-call-embedded ≥ 0.25.0-lotus.23 (older builds ignore it). if (CallEmbed.startingCall(intent)) { - params.append('sendNotificationType', CallEmbed.dmCall(intent) ? 'ring' : 'notification'); + let notify = 'none'; + if (isRingableRoom(room, CallEmbed.dmCall(intent))) { + notify = CallEmbed.dmCall(intent) ? 'ring' : 'notification'; + } + params.append('sendNotificationType', notify); } // [Gitea #43] On its own origin when config.json sets elementCallUrl.