[WIP] Chat Import

This commit is contained in:
Ali
2021-01-22 01:34:37 +04:00
parent b3740d69b3
commit 428766c75b
10 changed files with 441 additions and 8 deletions

View File

@@ -277,8 +277,10 @@ class ChatMessageTextBubbleContentNode: ChatMessageBubbleContentNode {
if let entities = entities {
attributedText = stringWithAppliedEntities(rawText, entities: entities, baseColor: messageTheme.primaryTextColor, linkColor: messageTheme.linkTextColor, baseFont: textFont, linkFont: textFont, boldFont: item.presentationData.messageBoldFont, italicFont: item.presentationData.messageItalicFont, boldItalicFont: item.presentationData.messageBoldItalicFont, fixedFont: item.presentationData.messageFixedFont, blockQuoteFont: item.presentationData.messageBlockQuoteFont)
} else {
} else if !rawText.isEmpty {
attributedText = NSAttributedString(string: rawText, font: textFont, textColor: messageTheme.primaryTextColor)
} else {
attributedText = NSAttributedString(string: " ", font: textFont, textColor: messageTheme.primaryTextColor)
}
var cutout: TextNodeCutout?
@@ -339,6 +341,12 @@ class ChatMessageTextBubbleContentNode: ChatMessageBubbleContentNode {
boundingSize.height += layoutConstants.text.bubbleInsets.top + layoutConstants.text.bubbleInsets.bottom
}
if attributedText.string.isEmpty, var adjustedStatusFrameValue = adjustedStatusFrame {
adjustedStatusFrameValue.origin.y = 1.0
boundingSize.height = adjustedStatusFrameValue.maxY + 5.0
adjustedStatusFrame = adjustedStatusFrameValue
}
return (boundingSize, { [weak self] animation, _ in
if let strongSelf = self {
strongSelf.item = item