From 82beb4be2b14f37c741cdeec2b74eda0938446de Mon Sep 17 00:00:00 2001 From: Arnfried Griesert Date: Thu, 17 Aug 2023 10:21:13 +0200 Subject: [PATCH] Patched hotfix changes from bum into hotfix branch 5068_hide_room_display_in_notifications --- Config/AppVersion.xcconfig | 2 +- RiotNSE/NotificationService.swift | 21 +++++++++++++++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/Config/AppVersion.xcconfig b/Config/AppVersion.xcconfig index 8b6d27ada..d9b25ea2a 100644 --- a/Config/AppVersion.xcconfig +++ b/Config/AppVersion.xcconfig @@ -16,5 +16,5 @@ // // Version -MARKETING_VERSION = 2.8.0 +MARKETING_VERSION = 2.8.2 CURRENT_PROJECT_VERSION = 20220714163152 diff --git a/RiotNSE/NotificationService.swift b/RiotNSE/NotificationService.swift index f7462e041..eb606666e 100644 --- a/RiotNSE/NotificationService.swift +++ b/RiotNSE/NotificationService.swift @@ -371,8 +371,14 @@ class NotificationService: UNNotificationServiceExtension { throw NSEError.displayNameNotAvailable } - bestAttemptContents[eventId]?.title = roomDisplayName - // At this stage we don't know the message type, so leave the body as set in didReceive. + // bwi: 5068 - hide content in message notifications + if BWIBuildSettings.shared.bwiHideNotificationMessageBody { + // Hide the content + bestAttemptContents[eventId]?.body = NotificationService.localizedString(forKey: "MESSAGE_PROTECTED") + } else { + bestAttemptContents[eventId]?.title = roomDisplayName + // At this stage we don't know the message type, so leave the body as set in didReceive. + } } } @@ -435,6 +441,7 @@ class NotificationService: UNNotificationServiceExtension { return } + content.title = newContent.title content.subtitle = newContent.subtitle content.body = newContent.body @@ -766,8 +773,14 @@ class NotificationService: UNNotificationServiceExtension { case .pollEnd: notificationTitle = self.messageTitle(for: eventSenderName, in: roomDisplayName) notificationBody = VectorL10n.pollTimelineEndedText - // bwi 1.9.15: hide content in pollend notifications - + + // bwi 5068: use standard ecryption title and body + if BWIBuildSettings.shared.bwiHideNotificationMessageBody { + // Hide the content + notificationTitle = nil + notificationBody = NotificationService.localizedString(forKey: "MESSAGE_PROTECTED") + } + default: break }