diff --git a/Riot/Assets/en.lproj/Localizable.strings b/Riot/Assets/en.lproj/Localizable.strings index f35b9b8a92..965fcfd4a4 100644 --- a/Riot/Assets/en.lproj/Localizable.strings +++ b/Riot/Assets/en.lproj/Localizable.strings @@ -83,6 +83,9 @@ /* Sticker from a specific person, not referencing a room. */ "STICKER_FROM_USER" = "%@ sent a sticker"; +/* New voice broadcast from a specific person, not referencing a room. */ +"VOICE_BROADCAST_FROM_USER" = "%@ started a voice broadcast"; + /** Notification messages **/ /* New message indicator on unknown room */ diff --git a/RiotNSE/NotificationService.swift b/RiotNSE/NotificationService.swift index 1d7f5cf074..977a71e824 100644 --- a/RiotNSE/NotificationService.swift +++ b/RiotNSE/NotificationService.swift @@ -471,7 +471,14 @@ class NotificationService: UNNotificationServiceExtension { notificationBody = NotificationService.localizedString(forKey: "VIDEO_FROM_USER", eventSenderName) case kMXMessageTypeAudio: if event.isVoiceMessage() { - notificationBody = NotificationService.localizedString(forKey: "VOICE_MESSAGE_FROM_USER", eventSenderName) + // Ignore voice broadcast chunk event except the first one. + if let chunkInfo = event.content[VoiceBroadcastSettings.voiceBroadcastContentKeyChunkType] as? [String: UInt] { + if chunkInfo[VoiceBroadcastSettings.voiceBroadcastContentKeyChunkSequence] == 1 { + notificationBody = NotificationService.localizedString(forKey: "VOICE_BROADCAST_FROM_USER", eventSenderName) + } + } else { + notificationBody = NotificationService.localizedString(forKey: "VOICE_MESSAGE_FROM_USER", eventSenderName) + } } else { notificationBody = NotificationService.localizedString(forKey: "AUDIO_FROM_USER", eventSenderName, messageContent) } diff --git a/changelog.d/pr-7230.change b/changelog.d/pr-7230.change new file mode 100644 index 0000000000..d5b48aadce --- /dev/null +++ b/changelog.d/pr-7230.change @@ -0,0 +1 @@ +Ignore the voice broadcast chunks at the notifications level \ No newline at end of file