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 5760c2bc53
commit 82beb4be2b
2 changed files with 18 additions and 5 deletions

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
}