mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-15 21:45:19 +00:00
Psa-related fixes
This commit is contained in:
parent
049cba24bf
commit
e43dcbfaca
@ -274,7 +274,7 @@ private final class AuthDataTransferSplashScreenNode: ViewControllerTracingNode
|
||||
return nil
|
||||
}
|
||||
}
|
||||
textNode.tapAttributeAction = { attributes in
|
||||
textNode.tapAttributeAction = { attributes, _ in
|
||||
if let _ = attributes[NSAttributedString.Key(rawValue: "URL")] {
|
||||
context.sharedContext.openExternalUrl(context: context, urlContext: .generic, url: "https://desktop.telegram.org", forceExternal: true, presentationData: context.sharedContext.currentPresentationData.with { $0 }, navigationController: nil, dismissInput: {})
|
||||
}
|
||||
|
@ -44,9 +44,13 @@ enum ChatContextMenuSource {
|
||||
case search(ChatListSearchContextActionSource)
|
||||
}
|
||||
|
||||
func chatContextMenuItems(context: AccountContext, peerId: PeerId, source: ChatContextMenuSource, chatListController: ChatListControllerImpl?) -> Signal<[ContextMenuItem], NoError> {
|
||||
func chatContextMenuItems(context: AccountContext, peerId: PeerId, promoInfo: ChatListNodeEntryPromoInfo?, source: ChatContextMenuSource, chatListController: ChatListControllerImpl?) -> Signal<[ContextMenuItem], NoError> {
|
||||
let strings = context.sharedContext.currentPresentationData.with({ $0 }).strings
|
||||
return context.account.postbox.transaction { [weak chatListController] transaction -> [ContextMenuItem] in
|
||||
if promoInfo != nil {
|
||||
return []
|
||||
}
|
||||
|
||||
var items: [ContextMenuItem] = []
|
||||
|
||||
if case let .search(search) = source {
|
||||
|
@ -801,10 +801,10 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController,
|
||||
chatListController.navigationPresentation = .master
|
||||
let contextController = ContextController(account: strongSelf.context.account, presentationData: strongSelf.presentationData, source: .controller(ContextControllerContentSourceImpl(controller: chatListController, sourceNode: node, navigationController: strongSelf.navigationController as? NavigationController)), items: archiveContextMenuItems(context: strongSelf.context, groupId: groupReference.groupId, chatListController: strongSelf), reactionItems: [], gesture: gesture)
|
||||
strongSelf.presentInGlobalOverlay(contextController)
|
||||
case let .peer(peer):
|
||||
let chatController = strongSelf.context.sharedContext.makeChatController(context: strongSelf.context, chatLocation: .peer(peer.peer.peerId), subject: nil, botStart: nil, mode: .standard(previewing: true))
|
||||
case let .peer(_, peer, _, _, _, _, _, _, promoInfo, _, _, _):
|
||||
let chatController = strongSelf.context.sharedContext.makeChatController(context: strongSelf.context, chatLocation: .peer(peer.peerId), subject: nil, botStart: nil, mode: .standard(previewing: true))
|
||||
chatController.canReadHistory.set(false)
|
||||
let contextController = ContextController(account: strongSelf.context.account, presentationData: strongSelf.presentationData, source: .controller(ContextControllerContentSourceImpl(controller: chatController, sourceNode: node, navigationController: strongSelf.navigationController as? NavigationController)), items: chatContextMenuItems(context: strongSelf.context, peerId: peer.peer.peerId, source: .chatList(filter: strongSelf.chatListDisplayNode.containerNode.currentItemNode.chatListFilter), chatListController: strongSelf), reactionItems: [], gesture: gesture)
|
||||
let contextController = ContextController(account: strongSelf.context.account, presentationData: strongSelf.presentationData, source: .controller(ContextControllerContentSourceImpl(controller: chatController, sourceNode: node, navigationController: strongSelf.navigationController as? NavigationController)), items: chatContextMenuItems(context: strongSelf.context, peerId: peer.peerId, promoInfo: promoInfo, source: .chatList(filter: strongSelf.chatListDisplayNode.containerNode.currentItemNode.chatListFilter), chatListController: strongSelf), reactionItems: [], gesture: gesture)
|
||||
strongSelf.presentInGlobalOverlay(contextController)
|
||||
}
|
||||
}
|
||||
@ -817,7 +817,7 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController,
|
||||
|
||||
let chatController = strongSelf.context.sharedContext.makeChatController(context: strongSelf.context, chatLocation: .peer(peer.id), subject: nil, botStart: nil, mode: .standard(previewing: true))
|
||||
chatController.canReadHistory.set(false)
|
||||
let contextController = ContextController(account: strongSelf.context.account, presentationData: strongSelf.presentationData, source: .controller(ContextControllerContentSourceImpl(controller: chatController, sourceNode: node, navigationController: strongSelf.navigationController as? NavigationController)), items: chatContextMenuItems(context: strongSelf.context, peerId: peer.id, source: .search(source), chatListController: strongSelf), reactionItems: [], gesture: gesture)
|
||||
let contextController = ContextController(account: strongSelf.context.account, presentationData: strongSelf.presentationData, source: .controller(ContextControllerContentSourceImpl(controller: chatController, sourceNode: node, navigationController: strongSelf.navigationController as? NavigationController)), items: chatContextMenuItems(context: strongSelf.context, peerId: peer.id, promoInfo: nil, source: .search(source), chatListController: strongSelf), reactionItems: [], gesture: gesture)
|
||||
strongSelf.presentInGlobalOverlay(contextController)
|
||||
}
|
||||
|
||||
|
@ -651,8 +651,10 @@ class ChatListItemNode: ItemListRevealOptionsItemNode {
|
||||
guard let item = self.item, item.editing else {
|
||||
return
|
||||
}
|
||||
if case .peer = item.content {
|
||||
item.interaction.togglePeerSelected(item.index.messageIndex.id.peerId)
|
||||
if case let .peer(_, _, _, _, _, _, _, _, promoInfo, _, _, _) = item.content {
|
||||
if promoInfo == nil {
|
||||
item.interaction.togglePeerSelected(item.index.messageIndex.id.peerId)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -60,8 +60,8 @@ public class ImmediateTextNode: TextNode {
|
||||
}
|
||||
}
|
||||
|
||||
public var tapAttributeAction: (([NSAttributedString.Key: Any]) -> Void)?
|
||||
public var longTapAttributeAction: (([NSAttributedString.Key: Any]) -> Void)?
|
||||
public var tapAttributeAction: (([NSAttributedString.Key: Any], Int) -> Void)?
|
||||
public var longTapAttributeAction: (([NSAttributedString.Key: Any], Int) -> Void)?
|
||||
|
||||
public func makeCopy() -> TextNode {
|
||||
let node = TextNode()
|
||||
@ -179,12 +179,12 @@ public class ImmediateTextNode: TextNode {
|
||||
if let (gesture, location) = recognizer.lastRecognizedGestureAndLocation {
|
||||
switch gesture {
|
||||
case .tap:
|
||||
if let (_, attributes) = self.attributesAtPoint(CGPoint(x: location.x, y: location.y)) {
|
||||
self.tapAttributeAction?(attributes)
|
||||
if let (index, attributes) = self.attributesAtPoint(CGPoint(x: location.x, y: location.y)) {
|
||||
self.tapAttributeAction?(attributes, index)
|
||||
}
|
||||
case .longTap:
|
||||
if let (_, attributes) = self.attributesAtPoint(CGPoint(x: location.x, y: location.y)) {
|
||||
self.longTapAttributeAction?(attributes)
|
||||
if let (index, attributes) = self.attributesAtPoint(CGPoint(x: location.x, y: location.y)) {
|
||||
self.longTapAttributeAction?(attributes, index)
|
||||
}
|
||||
default:
|
||||
break
|
||||
|
@ -147,7 +147,7 @@ public final class TextAlertContentNode: AlertContentNode {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
self.textNode.tapAttributeAction = { attributes in
|
||||
self.textNode.tapAttributeAction = { attributes, _ in
|
||||
if let value = attributes[attribute] {
|
||||
textAttributeAction(value)
|
||||
}
|
||||
|
@ -314,12 +314,12 @@ final class ChatItemGalleryFooterContentNode: GalleryFooterContentNode, UIScroll
|
||||
}
|
||||
return nil
|
||||
}
|
||||
self.textNode.tapAttributeAction = { [weak self] attributes in
|
||||
self.textNode.tapAttributeAction = { [weak self] attributes, _ in
|
||||
if let strongSelf = self, let action = strongSelf.actionForAttributes(attributes) {
|
||||
strongSelf.performAction?(action)
|
||||
}
|
||||
}
|
||||
self.textNode.longTapAttributeAction = { [weak self] attributes in
|
||||
self.textNode.longTapAttributeAction = { [weak self] attributes, _ in
|
||||
if let strongSelf = self, let action = strongSelf.actionForAttributes(attributes) {
|
||||
strongSelf.openActionOptions?(action)
|
||||
}
|
||||
|
@ -55,12 +55,12 @@ final class InstantPageGalleryFooterContentNode: GalleryFooterContentNode {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
self.textNode.tapAttributeAction = { [weak self] attributes in
|
||||
self.textNode.tapAttributeAction = { [weak self] attributes, _ in
|
||||
if let strongSelf = self, let url = attributes[NSAttributedString.Key(rawValue: TelegramTextAttributes.URL)] as? InstantPageUrlItem {
|
||||
strongSelf.openUrl?(url)
|
||||
}
|
||||
}
|
||||
self.textNode.longTapAttributeAction = { [weak self] attributes in
|
||||
self.textNode.longTapAttributeAction = { [weak self] attributes, _ in
|
||||
if let strongSelf = self, let url = attributes[NSAttributedString.Key(rawValue: TelegramTextAttributes.URL)] as? InstantPageUrlItem {
|
||||
strongSelf.openUrlOptions?(url)
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ final class LanguageLinkPreviewContentNode: ASDisplayNode, ShareContentContainer
|
||||
return nil
|
||||
}
|
||||
}
|
||||
self.textNode.tapAttributeAction = { attributes in
|
||||
self.textNode.tapAttributeAction = { attributes, _ in
|
||||
if let _ = attributes[NSAttributedString.Key(rawValue: TelegramTextAttributes.URL)] {
|
||||
let url: String
|
||||
if localizationInfo.platformUrl.isEmpty {
|
||||
|
@ -80,7 +80,7 @@ final class SecureIdAuthFormContentNode: ASDisplayNode, SecureIdAuthContentNode,
|
||||
return nil
|
||||
}
|
||||
}
|
||||
self.textNode.tapAttributeAction = { attributes in
|
||||
self.textNode.tapAttributeAction = { attributes, _ in
|
||||
if let url = attributes[NSAttributedString.Key(rawValue: TelegramTextAttributes.URL)] as? String {
|
||||
openURL(url)
|
||||
} else if let mention = attributes[NSAttributedString.Key(rawValue: TelegramTextAttributes.PeerMention)] as? TelegramPeerMention {
|
||||
|
@ -1561,13 +1561,16 @@ final class MessageHistoryTable: Table {
|
||||
|
||||
var forwardInfoFlags: Int8 = 1
|
||||
if forwardInfo.sourceId != nil {
|
||||
forwardInfoFlags |= 2
|
||||
forwardInfoFlags |= 1 << 1
|
||||
}
|
||||
if forwardInfo.sourceMessageId != nil {
|
||||
forwardInfoFlags |= 4
|
||||
forwardInfoFlags |= 1 << 2
|
||||
}
|
||||
if forwardInfo.authorSignature != nil {
|
||||
forwardInfoFlags |= 8
|
||||
forwardInfoFlags |= 1 << 3
|
||||
}
|
||||
if forwardInfo.psaType != nil {
|
||||
forwardInfoFlags |= 1 << 4
|
||||
}
|
||||
sharedBuffer.write(&forwardInfoFlags, offset: 0, length: 1)
|
||||
var forwardAuthorId: Int64 = forwardInfo.authorId?.toInt64() ?? 0
|
||||
@ -1599,6 +1602,17 @@ final class MessageHistoryTable: Table {
|
||||
sharedBuffer.write(&length, offset: 0, length: 4)
|
||||
}
|
||||
}
|
||||
|
||||
if let psaType = forwardInfo.psaType {
|
||||
if let data = psaType.data(using: .utf8, allowLossyConversion: true) {
|
||||
var length: Int32 = Int32(data.count)
|
||||
sharedBuffer.write(&length, offset: 0, length: 4)
|
||||
sharedBuffer.write(data)
|
||||
} else {
|
||||
var length: Int32 = 0
|
||||
sharedBuffer.write(&length, offset: 0, length: 4)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
var forwardInfoFlags: Int8 = 0
|
||||
sharedBuffer.write(&forwardInfoFlags, offset: 0, length: 1)
|
||||
|
@ -152,7 +152,7 @@ final class TermsOfServiceControllerNode: ViewControllerTracingNode {
|
||||
strongSelf.present(actionSheet, nil)
|
||||
}
|
||||
|
||||
self.contentTextNode.tapAttributeAction = { [weak self] attributes in
|
||||
self.contentTextNode.tapAttributeAction = { [weak self] attributes, _ in
|
||||
guard let strongSelf = self else {
|
||||
return
|
||||
}
|
||||
@ -164,7 +164,7 @@ final class TermsOfServiceControllerNode: ViewControllerTracingNode {
|
||||
showMentionActionSheet(mention)
|
||||
}
|
||||
}
|
||||
self.contentTextNode.longTapAttributeAction = { [weak self] attributes in
|
||||
self.contentTextNode.longTapAttributeAction = { [weak self] attributes, _ in
|
||||
guard let strongSelf = self else {
|
||||
return
|
||||
}
|
||||
|
@ -182,7 +182,7 @@ final class StickerPackPreviewControllerNode: ViewControllerTracingNode, UIScrol
|
||||
}
|
||||
}
|
||||
|
||||
self.contentTitleNode.tapAttributeAction = { attributes in
|
||||
self.contentTitleNode.tapAttributeAction = { attributes, _ in
|
||||
if let mention = attributes[NSAttributedString.Key(rawValue: TelegramTextAttributes.PeerTextMention)] as? String, mention.count > 1 {
|
||||
openMention(String(mention[mention.index(after: mention.startIndex)...]))
|
||||
}
|
||||
|
@ -169,7 +169,7 @@ final class AuthorizationSequenceSignUpControllerNode: ASDisplayNode, UITextFiel
|
||||
return nil
|
||||
}
|
||||
}
|
||||
self.termsNode.tapAttributeAction = { [weak self] attributes in
|
||||
self.termsNode.tapAttributeAction = { [weak self] attributes, _ in
|
||||
if let _ = attributes[NSAttributedString.Key(rawValue: TelegramTextAttributes.URL)] {
|
||||
self?.openTermsOfService?()
|
||||
}
|
||||
|
@ -6401,10 +6401,10 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
||||
return
|
||||
}
|
||||
switch item {
|
||||
case let .url(url):
|
||||
case let .url(url, concealed):
|
||||
switch action {
|
||||
case .tap:
|
||||
strongSelf.openUrl(url, concealed: false)
|
||||
strongSelf.openUrl(url, concealed: concealed)
|
||||
case .longTap:
|
||||
strongSelf.controllerInteraction?.longTap(.url(url), nil)
|
||||
}
|
||||
@ -6489,7 +6489,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
||||
return
|
||||
}
|
||||
switch item {
|
||||
case let .url(url):
|
||||
case let .url(url, concealed):
|
||||
switch action {
|
||||
case .tap:
|
||||
strongSelf.openUrl(url, concealed: false)
|
||||
@ -6575,14 +6575,14 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
||||
return
|
||||
}
|
||||
|
||||
let tooltipScreen = TooltipScreen(text: psaText, textEntities: psaEntities, icon: .info, location: .top, shouldDismissOnTouch: { point in
|
||||
let tooltipScreen = TooltipScreen(text: psaText, textEntities: psaEntities, icon: .info, location: .top, displayDuration: .custom(10.0), shouldDismissOnTouch: { point in
|
||||
return .ignore
|
||||
}, openActiveTextItem: { [weak self] item, action in
|
||||
guard let strongSelf = self else {
|
||||
return
|
||||
}
|
||||
switch item {
|
||||
case let .url(url):
|
||||
case let .url(url, concealed):
|
||||
switch action {
|
||||
case .tap:
|
||||
strongSelf.openUrl(url, concealed: false)
|
||||
|
@ -14,6 +14,7 @@ static_library(
|
||||
"//submodules/SyncCore:SyncCore#shared",
|
||||
"//submodules/TelegramCore:TelegramCore#shared",
|
||||
"//submodules/TextFormat:TextFormat",
|
||||
"//submodules/UrlEscaping:UrlEscaping",
|
||||
],
|
||||
frameworks = [
|
||||
"$SDKROOT/System/Library/Frameworks/Foundation.framework",
|
||||
|
@ -15,6 +15,7 @@ swift_library(
|
||||
"//submodules/SyncCore:SyncCore",
|
||||
"//submodules/TelegramCore:TelegramCore",
|
||||
"//submodules/TextFormat:TextFormat",
|
||||
"//submodules/UrlEscaping:UrlEscaping",
|
||||
],
|
||||
visibility = [
|
||||
"//visibility:public",
|
||||
|
@ -9,9 +9,10 @@ import SyncCore
|
||||
import TelegramCore
|
||||
import TextFormat
|
||||
import Postbox
|
||||
import UrlEscaping
|
||||
|
||||
public enum TooltipActiveTextItem {
|
||||
case url(String)
|
||||
case url(String, Bool)
|
||||
case mention(PeerId, String)
|
||||
case textMention(String)
|
||||
case botCommand(String)
|
||||
@ -26,6 +27,7 @@ public enum TooltipActiveTextAction {
|
||||
private final class TooltipScreenNode: ViewControllerTracingNode {
|
||||
private let icon: TooltipScreen.Icon?
|
||||
private let location: TooltipScreen.Location
|
||||
private let displayDuration: TooltipScreen.DisplayDuration
|
||||
private let shouldDismissOnTouch: (CGPoint) -> TooltipScreen.DismissOnTouch
|
||||
private let requestDismiss: () -> Void
|
||||
|
||||
@ -42,9 +44,10 @@ private final class TooltipScreenNode: ViewControllerTracingNode {
|
||||
|
||||
private var validLayout: ContainerViewLayout?
|
||||
|
||||
init(text: String, textEntities: [MessageTextEntity], icon: TooltipScreen.Icon?, location: TooltipScreen.Location, shouldDismissOnTouch: @escaping (CGPoint) -> TooltipScreen.DismissOnTouch, requestDismiss: @escaping () -> Void, openActiveTextItem: @escaping (TooltipActiveTextItem, TooltipActiveTextAction) -> Void) {
|
||||
init(text: String, textEntities: [MessageTextEntity], icon: TooltipScreen.Icon?, location: TooltipScreen.Location, displayDuration: TooltipScreen.DisplayDuration, shouldDismissOnTouch: @escaping (CGPoint) -> TooltipScreen.DismissOnTouch, requestDismiss: @escaping () -> Void, openActiveTextItem: @escaping (TooltipActiveTextItem, TooltipActiveTextAction) -> Void) {
|
||||
self.icon = icon
|
||||
self.location = location
|
||||
self.displayDuration = displayDuration
|
||||
self.shouldDismissOnTouch = shouldDismissOnTouch
|
||||
self.requestDismiss = requestDismiss
|
||||
|
||||
@ -127,12 +130,16 @@ private final class TooltipScreenNode: ViewControllerTracingNode {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
self.textNode.tapAttributeAction = { [weak self] attributes in
|
||||
guard let _ = self else {
|
||||
self.textNode.tapAttributeAction = { [weak self] attributes, index in
|
||||
guard let strongSelf = self else {
|
||||
return
|
||||
}
|
||||
if let url = attributes[NSAttributedString.Key(rawValue: TelegramTextAttributes.URL)] as? String {
|
||||
openActiveTextItem(.url(url), .tap)
|
||||
var concealed = true
|
||||
if let (attributeText, fullText) = strongSelf.textNode.attributeSubstring(name: TelegramTextAttributes.URL, index: index) {
|
||||
concealed = !doesUrlMatchText(url: url, text: attributeText, fullText: fullText)
|
||||
}
|
||||
openActiveTextItem(.url(url, concealed), .tap)
|
||||
} else if let mention = attributes[NSAttributedString.Key(rawValue: TelegramTextAttributes.PeerMention)] as? TelegramPeerMention {
|
||||
openActiveTextItem(.mention(mention.peerId, mention.mention), .tap)
|
||||
} else if let mention = attributes[NSAttributedString.Key(rawValue: TelegramTextAttributes.PeerTextMention)] as? String {
|
||||
@ -144,12 +151,16 @@ private final class TooltipScreenNode: ViewControllerTracingNode {
|
||||
}
|
||||
}
|
||||
|
||||
self.textNode.longTapAttributeAction = { [weak self] attributes in
|
||||
guard let _ = self else {
|
||||
self.textNode.longTapAttributeAction = { [weak self] attributes, index in
|
||||
guard let strongSelf = self else {
|
||||
return
|
||||
}
|
||||
if let url = attributes[NSAttributedString.Key(rawValue: TelegramTextAttributes.URL)] as? String {
|
||||
openActiveTextItem(.url(url), .longTap)
|
||||
var concealed = true
|
||||
if let (attributeText, fullText) = strongSelf.textNode.attributeSubstring(name: TelegramTextAttributes.URL, index: index) {
|
||||
concealed = !doesUrlMatchText(url: url, text: attributeText, fullText: fullText)
|
||||
}
|
||||
openActiveTextItem(.url(url, concealed), .longTap)
|
||||
} else if let mention = attributes[NSAttributedString.Key(rawValue: TelegramTextAttributes.PeerMention)] as? TelegramPeerMention {
|
||||
openActiveTextItem(.mention(mention.peerId, mention.mention), .longTap)
|
||||
} else if let mention = attributes[NSAttributedString.Key(rawValue: TelegramTextAttributes.PeerTextMention)] as? String {
|
||||
@ -357,10 +368,16 @@ public final class TooltipScreen: ViewController {
|
||||
case top
|
||||
}
|
||||
|
||||
public enum DisplayDuration {
|
||||
case `default`
|
||||
case custom(Double)
|
||||
}
|
||||
|
||||
public let text: String
|
||||
public let textEntities: [MessageTextEntity]
|
||||
private let icon: TooltipScreen.Icon?
|
||||
private let location: TooltipScreen.Location
|
||||
private let displayDuration: DisplayDuration
|
||||
private let shouldDismissOnTouch: (CGPoint) -> TooltipScreen.DismissOnTouch
|
||||
private let openActiveTextItem: (TooltipActiveTextItem, TooltipActiveTextAction) -> Void
|
||||
|
||||
@ -374,11 +391,12 @@ public final class TooltipScreen: ViewController {
|
||||
public var willBecomeDismissed: ((TooltipScreen) -> Void)?
|
||||
public var becameDismissed: ((TooltipScreen) -> Void)?
|
||||
|
||||
public init(text: String, textEntities: [MessageTextEntity] = [], icon: TooltipScreen.Icon?, location: TooltipScreen.Location, shouldDismissOnTouch: @escaping (CGPoint) -> TooltipScreen.DismissOnTouch, openActiveTextItem: @escaping (TooltipActiveTextItem, TooltipActiveTextAction) -> Void = { _, _ in }) {
|
||||
public init(text: String, textEntities: [MessageTextEntity] = [], icon: TooltipScreen.Icon?, location: TooltipScreen.Location, displayDuration: DisplayDuration = .default, shouldDismissOnTouch: @escaping (CGPoint) -> TooltipScreen.DismissOnTouch, openActiveTextItem: @escaping (TooltipActiveTextItem, TooltipActiveTextAction) -> Void = { _, _ in }) {
|
||||
self.text = text
|
||||
self.textEntities = textEntities
|
||||
self.icon = icon
|
||||
self.location = location
|
||||
self.displayDuration = displayDuration
|
||||
self.shouldDismissOnTouch = shouldDismissOnTouch
|
||||
self.openActiveTextItem = openActiveTextItem
|
||||
|
||||
@ -396,13 +414,21 @@ public final class TooltipScreen: ViewController {
|
||||
|
||||
self.controllerNode.animateIn()
|
||||
|
||||
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 5.0, execute: { [weak self] in
|
||||
let timeout: Double
|
||||
switch self.displayDuration {
|
||||
case .default:
|
||||
timeout = 5.0
|
||||
case let .custom(value):
|
||||
timeout = value
|
||||
}
|
||||
|
||||
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + timeout, execute: { [weak self] in
|
||||
self?.dismiss()
|
||||
})
|
||||
}
|
||||
|
||||
override public func loadDisplayNode() {
|
||||
self.displayNode = TooltipScreenNode(text: self.text, textEntities: self.textEntities, icon: self.icon, location: self.location, shouldDismissOnTouch: self.shouldDismissOnTouch, requestDismiss: { [weak self] in
|
||||
self.displayNode = TooltipScreenNode(text: self.text, textEntities: self.textEntities, icon: self.icon, location: self.location, displayDuration: self.displayDuration, shouldDismissOnTouch: self.shouldDismissOnTouch, requestDismiss: { [weak self] in
|
||||
guard let strongSelf = self else {
|
||||
return
|
||||
}
|
||||
|
@ -953,7 +953,7 @@ private final class WalletSplashScreenNode: ViewControllerTracingNode {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
self.termsNode.tapAttributeAction = { attributes in
|
||||
self.termsNode.tapAttributeAction = { attributes, _ in
|
||||
if let _ = attributes[NSAttributedString.Key.underlineStyle] {
|
||||
openTerms()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user