File tree Expand file tree Collapse file tree
Telegram/NotificationService/Sources Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1978,13 +1978,18 @@ private final class NotificationServiceHandler {
19781978 if let media = message. media. first {
19791979 parsedMedia = media
19801980 }
1981- if enableInlineEmoji, let textEntitiesAttribute = message. textEntitiesAttribute {
1982- content. body = message. text
1981+ if enableInlineEmoji, let textEntitiesAttribute = message. textEntitiesAttribute, let author = message. author {
1982+ let authorTitle = author. debugDisplayTitle
1983+ let messagePrefix = " \( authorTitle) : "
1984+ let messagePrefixLength = ( messagePrefix as NSString ) . length
19831985 for entity in textEntitiesAttribute. entities {
19841986 if case let . CustomEmoji( _, fileId) = entity. type {
1985- content. customEmoji. append ( NotificationContent . CustomEmoji ( range: entity. range, fileId: fileId) )
1987+ content. customEmoji. append ( NotificationContent . CustomEmoji ( range: ( entity. range. lowerBound + messagePrefixLength ) ..< ( entity . range . upperBound + messagePrefixLength ) , fileId: fileId) )
19861988 }
19871989 }
1990+ if !content. customEmoji. isEmpty {
1991+ content. body = messagePrefix + message. text
1992+ }
19881993 }
19891994 }
19901995
You can’t perform that action at this time.
0 commit comments