Emoji improvements

This commit is contained in:
Ali
2022-08-03 21:26:29 +04:00
parent eac396f944
commit 2aefab5b03
7 changed files with 98 additions and 62 deletions

View File

@@ -2610,7 +2610,8 @@ class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDelegate {
if replaceRange.location < 0 {
break
}
if inputText.attributedSubstring(from: replaceRange).string != previousText.string {
let adjacentString = inputText.attributedSubstring(from: replaceRange)
if adjacentString.string != previousText.string || adjacentString.attribute(ChatTextInputAttributes.customEmoji, at: 0, effectiveRange: nil) != nil {
break
}
inputText.replaceCharacters(in: replaceRange, with: NSAttributedString(string: text, attributes: [ChatTextInputAttributes.customEmoji: ChatTextInputTextCustomEmojiAttribute(stickerPack: emojiAttribute.stickerPack, fileId: emojiAttribute.fileId, file: emojiAttribute.file)]))