diff --git a/Riot/Assets/en.lproj/Localizable.strings b/Riot/Assets/en.lproj/Localizable.strings index ee2b62a28..c668ee02c 100644 --- a/Riot/Assets/en.lproj/Localizable.strings +++ b/Riot/Assets/en.lproj/Localizable.strings @@ -65,6 +65,9 @@ /* New audio message from a specific person, not referencing a room. */ "AUDIO_FROM_USER" = "%@ sent an audio file %@"; +/* New voice message from a specific person, not referencing a room. */ +"VOICE_MESSAGE_FROM_USER" = "%@ sent a voice message"; + /* New file message from a specific person, not referencing a room. */ "FILE_FROM_USER" = "%@ sent a file %@"; diff --git a/RiotNSE/NotificationService.swift b/RiotNSE/NotificationService.swift index d821ab8ae..b053fe113 100644 --- a/RiotNSE/NotificationService.swift +++ b/RiotNSE/NotificationService.swift @@ -383,7 +383,11 @@ class NotificationService: UNNotificationServiceExtension { case kMXMessageTypeVideo: notificationBody = NSString.localizedUserNotificationString(forKey: "VIDEO_FROM_USER", arguments: [eventSenderName, messageContent as Any]) case kMXMessageTypeAudio: - notificationBody = NSString.localizedUserNotificationString(forKey: "AUDIO_FROM_USER", arguments: [eventSenderName, messageContent as Any]) + if event.isVoiceMessage() { + notificationBody = NSString.localizedUserNotificationString(forKey: "VOICE_MESSAGE_FROM_USER", arguments: [eventSenderName]) + } else { + notificationBody = NSString.localizedUserNotificationString(forKey: "AUDIO_FROM_USER", arguments: [eventSenderName, messageContent as Any]) + } case kMXMessageTypeFile: notificationBody = NSString.localizedUserNotificationString(forKey: "FILE_FROM_USER", arguments: [eventSenderName, messageContent as Any])