From 2bed5fab1883b23cf1bbedd7da520760a48ac97d Mon Sep 17 00:00:00 2001 From: Isaac <> Date: Wed, 4 Feb 2026 18:01:47 +0800 Subject: [PATCH] Re-commit --- .../Sources/NotificationService.swift | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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 + } } }