fix(call): ringtone loudness, caller decline notice, All-Muted badge

Three issues from live testing:
- A1: the 'classic' ringtone (call.ogg, mastered near full scale) was much
  louder than the synthesized styles. Attenuate it (CLASSIC_GAIN 0.45) so all
  ringtones sit at a comparable level.
- A3/A4: the caller had no indication when a DM/group callee declined — their
  UI kept "ringing" until the notification lifetime expired. IncomingCallListener
  now listens for RTCDecline events for a call we're hosting in the room and
  toasts the caller ("<name> declined your call").
- G1: the PiP "All muted" badge fired when any single remote participant muted.
  useRemoteAllMuted now returns true only when there is >=1 remote and every
  remote participant is muted.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-29 19:13:40 -04:00
parent 6ace96f2cf
commit 5ef0a1fd3e
3 changed files with 41 additions and 5 deletions
+7 -3
View File
@@ -145,13 +145,17 @@ export const useRemoteAllMuted = (callEmbed: CallEmbed | undefined): boolean =>
// Each participant's mute icon has data-muted="true"|"false" and
// aria-label set to their Matrix user ID.
const muteIcons = doc.querySelectorAll<HTMLElement>('[data-muted]');
let anyRemoteMuted = false;
let remoteCount = 0;
let remoteMutedCount = 0;
muteIcons.forEach((el) => {
const userId = el.getAttribute('aria-label') ?? '';
if (userId === localUserId) return;
if (el.getAttribute('data-muted') === 'true') anyRemoteMuted = true;
remoteCount += 1;
if (el.getAttribute('data-muted') === 'true') remoteMutedCount += 1;
});
setMuted(anyRemoteMuted);
// "All muted" badge: true only when there is at least one remote
// participant and every one of them is muted (not merely any single one).
setMuted(remoteCount > 0 && remoteMutedCount === remoteCount);
};
let tileObserver: MutationObserver | undefined;