Skip to content

Commit

Permalink
Add changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
yostyle committed Jan 6, 2023
1 parent 6b3eeaa commit 3b6639b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
18 changes: 8 additions & 10 deletions RiotNSE/NotificationService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -470,11 +470,14 @@ class NotificationService: UNNotificationServiceExtension {
case kMXMessageTypeVideo:
notificationBody = NotificationService.localizedString(forKey: "VIDEO_FROM_USER", eventSenderName)
case kMXMessageTypeAudio:
if event.isVoiceMessage() {
notificationBody = NotificationService.localizedString(forKey: "VOICE_MESSAGE_FROM_USER", eventSenderName)
} else {
notificationBody = NotificationService.localizedString(forKey: "AUDIO_FROM_USER", eventSenderName, messageContent)
}
if event.isVoiceMessage() {
// Ignore voice broadcast chunk event
if event.content[VoiceBroadcastSettings.voiceBroadcastContentKeyChunkType] == nil {
notificationBody = NotificationService.localizedString(forKey: "VOICE_MESSAGE_FROM_USER", eventSenderName)
}
} else {
notificationBody = NotificationService.localizedString(forKey: "AUDIO_FROM_USER", eventSenderName, messageContent)
}
case kMXMessageTypeFile:
notificationBody = NotificationService.localizedString(forKey: "FILE_FROM_USER", eventSenderName, messageContent)

Expand Down Expand Up @@ -774,11 +777,6 @@ class NotificationService: UNNotificationServiceExtension {
return Constants.callInviteNotificationCategoryIdentifier
}

// Ignore voice broadcast chunk event
if event.eventType == .roomMessage && event.content[VoiceBroadcastSettings.voiceBroadcastContentKeyChunkType] != nil {
return Constants.toBeRemovedNotificationCategoryIdentifier
}

guard event.eventType == .roomMessage || event.eventType == .roomEncrypted else {
return Constants.toBeRemovedNotificationCategoryIdentifier
}
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

0 comments on commit 3b6639b

Please sign in to comment.