Merge pull request #3435 from vector-im/fix_3423

Fix Losing Sound on Notifications
This commit is contained in:
ismailgulek 2020-07-17 13:30:22 +03:00 committed by GitHub
commit eb444a0754
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View file

@ -39,6 +39,7 @@ Bug fix:
* Universal links: Fix broken links for web apps (#3420).
* SettingsViewController: Fix pan gesture crash (#3396).
* RecentsViewController: Fix crash on dequeue some cells (#3433).
* NotificationService: Fix losing sound when not showing decrypted content in notifications (#3423).
Changes in 0.11.6 (2020-06-30)
===============================================

View file

@ -168,8 +168,8 @@ class NotificationService: UNNotificationServiceExtension {
// encrypted
if !self.showDecryptedContentInNotifications {
// do not show decrypted content in notification
NSLog("[NotificationService] fetchEvent: Do not show decrypted content in notifications.")
self.fallbackToBestAttemptContent(forEventId: event.eventId)
NSLog("[NotificationService] fetchEvent: Do not show decrypted content in notifications, no need to attempt to decrypt it.")
self.processEvent(event)
return
}
@ -399,7 +399,7 @@ class NotificationService: UNNotificationServiceExtension {
})
} else {
// Encrypted messages falls here
notificationBody = NSString.localizedUserNotificationString(forKey: "MESSAGE_IN_X", arguments: [eventSenderName as Any])
notificationBody = NSString.localizedUserNotificationString(forKey: "MESSAGE", arguments: [])
}
} else {
notificationTitle = eventSenderName
@ -416,7 +416,7 @@ class NotificationService: UNNotificationServiceExtension {
break
default:
// Encrypted messages falls here
notificationBody = NSString.localizedUserNotificationString(forKey: "MESSAGE_FROM_X", arguments: [eventSenderName as Any])
notificationBody = NSString.localizedUserNotificationString(forKey: "MESSAGE", arguments: [])
break
}
}