Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Riot/Assets/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
9 changes: 8 additions & 1 deletion RiotNSE/NotificationService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
1 change: 1 addition & 0 deletions changelog.d/pr-7230.change
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Ignore the voice broadcast chunks at the notifications level