Skip to content

Commit

Permalink
Clarify the mention copy in notifications.
Browse files Browse the repository at this point in the history
  • Loading branch information
pixlwave committed Aug 22, 2024
1 parent 304070e commit b1efff6
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions NSE/Sources/NotificationContentBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit b1efff6

Please sign in to comment.