Mute broadcast chunk notifications

This commit is contained in:
Michael Weimann 2023-01-03 10:02:28 +01:00
parent 6d6adc8c02
commit cb4e444a60
No known key found for this signature in database
GPG key ID: 53F535A266BB9584
3 changed files with 50 additions and 0 deletions

View file

@ -50,6 +50,7 @@ import { localNotificationsAreSilenced, createLocalNotificationSettingsIfNeeded
import { getIncomingCallToastKey, IncomingCallToast } from "./toasts/IncomingCallToast";
import ToastStore from "./stores/ToastStore";
import { ElementCall } from "./models/Call";
import { VoiceBroadcastChunkEventType } from "./voice-broadcast";
/*
* Dispatches:
@ -77,6 +78,13 @@ const msgTypeHandlers = {
[M_LOCATION.altName]: (event: MatrixEvent) => {
return TextForEvent.textForLocationEvent(event)();
},
[MsgType.Audio]: (event: MatrixEvent): string | null => {
if (event.getContent()?.[VoiceBroadcastChunkEventType]) {
// mute broadcast chunks
return null;
}
return TextForEvent.textForEvent(event);
},
};
export const Notifier = {