Fix web preview

This commit is contained in:
Ali 2022-06-10 23:20:46 +04:00
parent 0608b573f9
commit 04003556f0
3 changed files with 23 additions and 12 deletions

View File

@ -811,7 +811,9 @@ public final class ListMessageSnippetItemNode: ListMessageNode {
if case .longTap = gesture {
item.interaction.longTap(ChatControllerInteractionLongTapAction.url(url), message)
} else if url == self.currentPrimaryUrl {
if !item.interaction.openMessage(message, .default) {
if let webpage = self.currentMedia as? TelegramMediaWebpage, case let .Loaded(content) = webpage.content, content.instantPage != nil {
item.interaction.openInstantPage(message, nil)
} else {
item.interaction.openUrl(url, false, false, nil)
}
} else {

View File

@ -222,7 +222,7 @@
"decimalSeparator": ",",
"symbolOnLeft": false,
"spaceBetweenAmountAndSymbol": true,
"decimalDigits": 2
"decimalDigits": 0
},
"BZD": {
"code": "BZD",
@ -321,7 +321,7 @@
"decimalSeparator": ".",
"symbolOnLeft": true,
"spaceBetweenAmountAndSymbol": false,
"decimalDigits": 2
"decimalDigits": 0
},
"CZK": {
"code": "CZK",
@ -546,7 +546,7 @@
"decimalSeparator": ",",
"symbolOnLeft": true,
"spaceBetweenAmountAndSymbol": false,
"decimalDigits": 0
"decimalDigits": 2
},
"ILS": {
"code": "ILS",
@ -573,7 +573,7 @@
"decimalSeparator": ".",
"symbolOnLeft": true,
"spaceBetweenAmountAndSymbol": true,
"decimalDigits": 2
"decimalDigits": 3
},
"IRR": {
"code": "IRR",
@ -654,7 +654,7 @@
"decimalSeparator": ".",
"symbolOnLeft": false,
"spaceBetweenAmountAndSymbol": false,
"decimalDigits": 2
"decimalDigits": 0
},
"KPW": {
"code": "KPW",
@ -825,7 +825,7 @@
"decimalSeparator": ".",
"symbolOnLeft": false,
"spaceBetweenAmountAndSymbol": false,
"decimalDigits": 2
"decimalDigits": 1
},
"MTL": {
"code": "MTL",
@ -1014,7 +1014,7 @@
"decimalSeparator": ",",
"symbolOnLeft": true,
"spaceBetweenAmountAndSymbol": true,
"decimalDigits": 2
"decimalDigits": 0
},
"QAR": {
"code": "QAR",
@ -1059,7 +1059,7 @@
"decimalSeparator": ",",
"symbolOnLeft": true,
"spaceBetweenAmountAndSymbol": true,
"decimalDigits": 2
"decimalDigits": 0
},
"SAR": {
"code": "SAR",
@ -1302,7 +1302,7 @@
"decimalSeparator": ".",
"symbolOnLeft": true,
"spaceBetweenAmountAndSymbol": false,
"decimalDigits": 2
"decimalDigits": 0
},
"USD": {
"code": "USD",
@ -1401,7 +1401,7 @@
"decimalSeparator": ",",
"symbolOnLeft": false,
"spaceBetweenAmountAndSymbol": false,
"decimalDigits": 2
"decimalDigits": 0
},
"XPF": {
"code": "XPF",
@ -1410,7 +1410,7 @@
"decimalSeparator": ".",
"symbolOnLeft": false,
"spaceBetweenAmountAndSymbol": false,
"decimalDigits": 2
"decimalDigits": 0
},
"YER": {
"code": "YER",

View File

@ -826,6 +826,12 @@ final class ChatMessageAttachedContentNode: ASDisplayNode {
if let statusSizeAndApply = statusSizeAndApply {
adjustedBoundingSize.height += statusSizeAndApply.0.height
adjustedLineHeight += statusSizeAndApply.0.height
if let imageFrame = imageFrame, statusSizeAndApply.0.height == 0.0 {
if statusInText {
adjustedBoundingSize.height = max(adjustedBoundingSize.height, imageFrame.maxY + 8.0 + 15.0)
}
}
}
adjustedBoundingSize.width = max(boundingWidth, adjustedBoundingSize.width)
@ -975,6 +981,9 @@ final class ChatMessageAttachedContentNode: ASDisplayNode {
var statusFrame = CGRect(origin: CGPoint(x: strongSelf.textNode.frame.minX, y: strongSelf.textNode.frame.maxY), size: statusSizeAndApply.0)
if let imageFrame = imageFrame {
statusFrame.origin.y = max(statusFrame.minY, imageFrame.maxY + 2.0)
if statusFrame.height == 0.0 {
statusFrame.origin.y += 14.0
}
}
if strongSelf.statusNode.supernode == nil {
strongSelf.addSubnode(strongSelf.statusNode)