mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
Re-commit
This commit is contained in:
parent
cb802c524e
commit
2bed5fab18
1 changed files with 8 additions and 3 deletions
|
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue