From a1cb6bd3764efbc2acdede103b9149fe0478fb29 Mon Sep 17 00:00:00 2001 From: Doug <6060466+pixlwave@users.noreply.github.com> Date: Thu, 22 Aug 2024 12:51:05 +0100 Subject: [PATCH] Clarify the mention copy in notifications. (#3142) --- NSE/Sources/NotificationContentBuilder.swift | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/NSE/Sources/NotificationContentBuilder.swift b/NSE/Sources/NotificationContentBuilder.swift index 569d90852..5361f3587 100644 --- a/NSE/Sources/NotificationContentBuilder.swift +++ b/NSE/Sources/NotificationContentBuilder.swift @@ -103,9 +103,7 @@ struct NotificationContentBuilder { var notification = try await processCommonRoomMessage(notificationItem: notificationItem, mediaProvider: mediaProvider) let displayName = notificationItem.senderDisplayName ?? notificationItem.roomDisplayName - let message = String(messageEventStringBuilder.buildAttributedString(for: messageType, senderDisplayName: displayName).characters) - - notification.body = notificationItem.hasMention ? L10n.notificationMentionedYouBody(message) : message + notification.body = String(messageEventStringBuilder.buildAttributedString(for: messageType, senderDisplayName: displayName).characters) switch messageType { case .image(content: let content): @@ -153,9 +151,14 @@ struct NotificationContentBuilder { } notification.categoryIdentifier = NotificationConstants.Category.message + let senderName = if let displayName = notificationItem.senderDisplayName { + notificationItem.hasMention ? L10n.notificationSenderMentionReply(displayName) : displayName + } else { + notificationItem.roomDisplayName + } notification = try await notification.addSenderIcon(using: mediaProvider, senderID: notificationItem.senderID, - senderName: notificationItem.senderDisplayName ?? notificationItem.roomDisplayName, + senderName: senderName, icon: icon(for: notificationItem)) return notification }