mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Clarify the mention copy in notifications. (#3142)
This commit is contained in:
@@ -103,9 +103,7 @@ struct NotificationContentBuilder {
|
|||||||
var notification = try await processCommonRoomMessage(notificationItem: notificationItem, mediaProvider: mediaProvider)
|
var notification = try await processCommonRoomMessage(notificationItem: notificationItem, mediaProvider: mediaProvider)
|
||||||
|
|
||||||
let displayName = notificationItem.senderDisplayName ?? notificationItem.roomDisplayName
|
let displayName = notificationItem.senderDisplayName ?? notificationItem.roomDisplayName
|
||||||
let message = String(messageEventStringBuilder.buildAttributedString(for: messageType, senderDisplayName: displayName).characters)
|
notification.body = String(messageEventStringBuilder.buildAttributedString(for: messageType, senderDisplayName: displayName).characters)
|
||||||
|
|
||||||
notification.body = notificationItem.hasMention ? L10n.notificationMentionedYouBody(message) : message
|
|
||||||
|
|
||||||
switch messageType {
|
switch messageType {
|
||||||
case .image(content: let content):
|
case .image(content: let content):
|
||||||
@@ -153,9 +151,14 @@ struct NotificationContentBuilder {
|
|||||||
}
|
}
|
||||||
notification.categoryIdentifier = NotificationConstants.Category.message
|
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,
|
notification = try await notification.addSenderIcon(using: mediaProvider,
|
||||||
senderID: notificationItem.senderID,
|
senderID: notificationItem.senderID,
|
||||||
senderName: notificationItem.senderDisplayName ?? notificationItem.roomDisplayName,
|
senderName: senderName,
|
||||||
icon: icon(for: notificationItem))
|
icon: icon(for: notificationItem))
|
||||||
return notification
|
return notification
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user