From 097d812be8d993bed190e24971798b763eacddfe Mon Sep 17 00:00:00 2001 From: ismailgulek Date: Fri, 17 Jul 2020 13:00:40 +0300 Subject: [PATCH 1/3] Avoid early fallback when not showing decrypted content in notifications --- RiotNSE/NotificationService.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RiotNSE/NotificationService.swift b/RiotNSE/NotificationService.swift index 8301920ea..7399ae4cd 100644 --- a/RiotNSE/NotificationService.swift +++ b/RiotNSE/NotificationService.swift @@ -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 } From 59205aa7d5b5bef2d2302af258d71d37cbc7853f Mon Sep 17 00:00:00 2001 From: ismailgulek Date: Fri, 17 Jul 2020 13:01:30 +0300 Subject: [PATCH 2/3] Remove redundant event sender names in notification body, they're already in the title --- RiotNSE/NotificationService.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RiotNSE/NotificationService.swift b/RiotNSE/NotificationService.swift index 7399ae4cd..ef8e24c23 100644 --- a/RiotNSE/NotificationService.swift +++ b/RiotNSE/NotificationService.swift @@ -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 } } From a22ba48cb6116b2adc87b04d9e549dc3d9b6e2ee Mon Sep 17 00:00:00 2001 From: ismailgulek Date: Fri, 17 Jul 2020 13:02:29 +0300 Subject: [PATCH 3/3] Update CHANGES.rst --- CHANGES.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.rst b/CHANGES.rst index 05adfce22..09dc9f225 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -38,6 +38,7 @@ Bug fix: * Main.storyboard: Set storyboard identifier for SettingsViewController (#3398). * Universal links: Fix broken links for web apps (#3420). * SettingsViewController: Fix pan gesture crash (#3396). + * NotificationService: Fix losing sound when not showing decrypted content in notifications (#3423). Changes in 0.11.6 (2020-06-30) ===============================================