mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Merge commit '7c9129a97e60756fe9f33327d62ffe300abe6502' into beta
This commit is contained in:
commit
e94a62b0d9
@ -27,6 +27,7 @@ swift_library(
|
|||||||
"//submodules/StickerPackPreviewUI:StickerPackPreviewUI",
|
"//submodules/StickerPackPreviewUI:StickerPackPreviewUI",
|
||||||
"//submodules/OverlayStatusController:OverlayStatusController",
|
"//submodules/OverlayStatusController:OverlayStatusController",
|
||||||
"//submodules/PresentationDataUtils:PresentationDataUtils",
|
"//submodules/PresentationDataUtils:PresentationDataUtils",
|
||||||
|
"//submodules/UrlEscaping:UrlEscaping",
|
||||||
],
|
],
|
||||||
visibility = [
|
visibility = [
|
||||||
"//visibility:public",
|
"//visibility:public",
|
||||||
|
@ -18,6 +18,7 @@ import OpenInExternalAppUI
|
|||||||
import AppBundle
|
import AppBundle
|
||||||
import LocalizedPeerData
|
import LocalizedPeerData
|
||||||
import TextSelectionNode
|
import TextSelectionNode
|
||||||
|
import UrlEscaping
|
||||||
|
|
||||||
private let deleteImage = generateTintedImage(image: UIImage(bundleImageName: "Chat/Input/Accessory Panels/MessageSelectionTrash"), color: .white)
|
private let deleteImage = generateTintedImage(image: UIImage(bundleImageName: "Chat/Input/Accessory Panels/MessageSelectionTrash"), color: .white)
|
||||||
private let actionImage = generateTintedImage(image: UIImage(bundleImageName: "Chat/Input/Accessory Panels/MessageSelectionForward"), color: .white)
|
private let actionImage = generateTintedImage(image: UIImage(bundleImageName: "Chat/Input/Accessory Panels/MessageSelectionForward"), color: .white)
|
||||||
@ -331,13 +332,13 @@ final class ChatItemGalleryFooterContentNode: GalleryFooterContentNode, UIScroll
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
self.textNode.tapAttributeAction = { [weak self] attributes, _ in
|
self.textNode.tapAttributeAction = { [weak self] attributes, index in
|
||||||
if let strongSelf = self, let action = strongSelf.actionForAttributes(attributes) {
|
if let strongSelf = self, let action = strongSelf.actionForAttributes(attributes, index) {
|
||||||
strongSelf.performAction?(action)
|
strongSelf.performAction?(action)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
self.textNode.longTapAttributeAction = { [weak self] attributes, _ in
|
self.textNode.longTapAttributeAction = { [weak self] attributes, index in
|
||||||
if let strongSelf = self, let action = strongSelf.actionForAttributes(attributes) {
|
if let strongSelf = self, let action = strongSelf.actionForAttributes(attributes, index) {
|
||||||
strongSelf.openActionOptions?(action)
|
strongSelf.openActionOptions?(action)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -391,9 +392,13 @@ final class ChatItemGalleryFooterContentNode: GalleryFooterContentNode, UIScroll
|
|||||||
self.scrollNode.view.showsVerticalScrollIndicator = false
|
self.scrollNode.view.showsVerticalScrollIndicator = false
|
||||||
}
|
}
|
||||||
|
|
||||||
private func actionForAttributes(_ attributes: [NSAttributedString.Key: Any]) -> GalleryControllerInteractionTapAction? {
|
private func actionForAttributes(_ attributes: [NSAttributedString.Key: Any], _ index: Int) -> GalleryControllerInteractionTapAction? {
|
||||||
if let url = attributes[NSAttributedString.Key(rawValue: TelegramTextAttributes.URL)] as? String {
|
if let url = attributes[NSAttributedString.Key(rawValue: TelegramTextAttributes.URL)] as? String {
|
||||||
return .url(url: url, concealed: false)
|
var concealed = true
|
||||||
|
if let (attributeText, fullText) = self.textNode.attributeSubstring(name: TelegramTextAttributes.URL, index: index) {
|
||||||
|
concealed = !doesUrlMatchText(url: url, text: attributeText, fullText: fullText)
|
||||||
|
}
|
||||||
|
return .url(url: url, concealed: concealed)
|
||||||
} else if let peerMention = attributes[NSAttributedString.Key(rawValue: TelegramTextAttributes.PeerMention)] as? TelegramPeerMention {
|
} else if let peerMention = attributes[NSAttributedString.Key(rawValue: TelegramTextAttributes.PeerMention)] as? TelegramPeerMention {
|
||||||
return .peerMention(peerMention.peerId, peerMention.mention)
|
return .peerMention(peerMention.peerId, peerMention.mention)
|
||||||
} else if let peerName = attributes[NSAttributedString.Key(rawValue: TelegramTextAttributes.PeerTextMention)] as? String {
|
} else if let peerName = attributes[NSAttributedString.Key(rawValue: TelegramTextAttributes.PeerTextMention)] as? String {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user