diff --git a/Telegram/NotificationService/Sources/NotificationService.swift b/Telegram/NotificationService/Sources/NotificationService.swift index de697ef595..bde66723dd 100644 --- a/Telegram/NotificationService/Sources/NotificationService.swift +++ b/Telegram/NotificationService/Sources/NotificationService.swift @@ -1978,13 +1978,18 @@ private final class NotificationServiceHandler { if let media = message.media.first { parsedMedia = media } - if enableInlineEmoji, let textEntitiesAttribute = message.textEntitiesAttribute { - content.body = message.text + if enableInlineEmoji, let textEntitiesAttribute = message.textEntitiesAttribute, let author = message.author { + let authorTitle = author.debugDisplayTitle + let messagePrefix = "\(authorTitle): " + let messagePrefixLength = (messagePrefix as NSString).length for entity in textEntitiesAttribute.entities { if case let .CustomEmoji(_, fileId) = entity.type { - content.customEmoji.append(NotificationContent.CustomEmoji(range: entity.range, fileId: fileId)) + content.customEmoji.append(NotificationContent.CustomEmoji(range: (entity.range.lowerBound + messagePrefixLength) ..< (entity.range.upperBound + messagePrefixLength), fileId: fileId)) } } + if !content.customEmoji.isEmpty { + content.body = messagePrefix + message.text + } } }