Mentioned notifications copy improvement (#2144)

This commit is contained in:
Mauro
2023-11-22 14:16:03 +01:00
committed by GitHub
parent 99f5601330
commit d11562692c
4 changed files with 37 additions and 28 deletions
+2 -11
View File
@@ -101,17 +101,8 @@ struct NotificationContentBuilder {
let displayName = notificationItem.senderDisplayName ?? notificationItem.roomDisplayName
let message = String(messageEventStringBuilder.buildAttributedString(for: messageType, senderDisplayName: displayName, prefixWithSenderName: false).characters)
let body: String
if notificationItem.hasMention {
if let senderDisplayName = notificationItem.senderDisplayName {
body = L10n.notificationMentionedYouBody(senderDisplayName, message)
} else {
body = L10n.notificationMentionedYouFallbackBody(message)
}
} else {
body = message
}
notification.body = body
notification.body = notificationItem.hasMention ? L10n.notificationMentionedYouBody(message) : message
switch messageType {
case .image(content: let content):