mentioned you improvement

This commit is contained in:
Mauro Romito
2023-11-22 13:48:45 +01:00
parent a7c194198d
commit 0ecb156020
3 changed files with 36 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):