mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Custom copy for notifications that contain mentions (#2050)
This commit is contained in:
@@ -99,8 +99,19 @@ struct NotificationContentBuilder {
|
||||
private func processRoomMessage(notificationItem: NotificationItemProxyProtocol, messageType: MessageType, mediaProvider: MediaProviderProtocol?) async throws -> UNMutableNotificationContent {
|
||||
var notification = try await processCommonRoomMessage(notificationItem: notificationItem, mediaProvider: mediaProvider)
|
||||
|
||||
let senderDisplayName = notificationItem.senderDisplayName ?? notificationItem.roomDisplayName
|
||||
notification.body = String(messageEventStringBuilder.buildAttributedString(for: messageType, senderDisplayName: senderDisplayName, prefixWithSenderName: false).characters)
|
||||
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
|
||||
|
||||
switch messageType {
|
||||
case .image(content: let content):
|
||||
|
||||
Reference in New Issue
Block a user