diff --git a/submodules/TelegramUI/Components/TextFieldComponent/Sources/TextFieldComponent.swift b/submodules/TelegramUI/Components/TextFieldComponent/Sources/TextFieldComponent.swift index ad7753684b..24f6b9349c 100644 --- a/submodules/TelegramUI/Components/TextFieldComponent/Sources/TextFieldComponent.swift +++ b/submodules/TelegramUI/Components/TextFieldComponent/Sources/TextFieldComponent.swift @@ -825,9 +825,13 @@ public final class TextFieldComponent: Component { var rightmostX = lineRect.maxX + padding let rightmostY = lineRect.minY + self.textView.textContainerInset.top - let stringIndex = self.textView.text.index(self.textView.text.startIndex, offsetBy: lineRange.location + lineRange.length - 1) - if self.textView.text[stringIndex] == " " { - rightmostX -= 3.0 + let nsString = (self.textView.text as NSString) + let firstLineEndRange = NSMakeRange(lineRange.location + lineRange.length - 1, 1) + if nsString.length > firstLineEndRange.location + firstLineEndRange.length { + let lastChar = nsString.substring(with: firstLineEndRange) + if lastChar == " " { + rightmostX -= 2.0 + } } return CGPoint(x: rightmostX, y: rightmostY) diff --git a/submodules/TelegramUI/Sources/ChatController.swift b/submodules/TelegramUI/Sources/ChatController.swift index 22b5b41351..8ec6cdceca 100644 --- a/submodules/TelegramUI/Sources/ChatController.swift +++ b/submodules/TelegramUI/Sources/ChatController.swift @@ -19381,6 +19381,8 @@ func canAddMessageReactions(message: Message) -> Bool { if story.isMention { return false } + } else if let _ = media as? TelegramMediaExpiredContent { + return false } } return true