mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-11-06 17:00:13 +00:00
Don't call basicEmoji for every message
This commit is contained in:
parent
dfb61a3267
commit
1ad7b99f4f
@ -39,7 +39,8 @@ func chatHistoryEntriesForView(location: ChatLocation, view: MessageHistoryView,
|
||||
|
||||
var contentTypeHint: ChatMessageEntryContentType = .generic
|
||||
if presentationData.largeEmoji {
|
||||
if let _ = associatedData.animatedEmojiStickers[entry.message.text.basicEmoji.0] {
|
||||
let messageText = entry.message.text
|
||||
if messageText.count == 1, let _ = associatedData.animatedEmojiStickers[messageText.basicEmoji.0] {
|
||||
contentTypeHint = .animatedEmoji
|
||||
} else if messageIsElligibleForLargeEmoji(entry.message) {
|
||||
contentTypeHint = .largeEmoji
|
||||
|
||||
@ -152,12 +152,4 @@ extension String {
|
||||
}
|
||||
return (string, fitzModifier)
|
||||
}
|
||||
|
||||
var trimmedEmoji: String {
|
||||
if self.unicodeScalars.count > 1, self.unicodeScalars.first?.value == 0x2764, self.emojis.count == 1 {
|
||||
return String(self.unicodeScalars.prefix(self.unicodeScalars.count - 1))
|
||||
} else {
|
||||
return self
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user