Patched hotfix changes from bum into hotfix branch 5068_hide_room_display_in_notifications

This commit is contained in:
Arnfried Griesert
2023-08-17 10:21:13 +02:00
parent ac3a3f6698
commit 2f207091db
2 changed files with 18 additions and 5 deletions
+1 -1
View File
@@ -16,5 +16,5 @@
//
// Version
MARKETING_VERSION = 2.8.0
MARKETING_VERSION = 2.8.2
CURRENT_PROJECT_VERSION = 20220714163152
+17 -4
View File
@@ -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
}