mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Pass url progress for ad messages
This commit is contained in:
parent
baeb8fe9a6
commit
171608d11a
@ -755,7 +755,7 @@ public final class ChatMessageAvatarHeaderNodeImpl: ListViewItemHeaderNode, Chat
|
|||||||
self.controllerInteraction?.displayMessageTooltip(id, self.presentationData.strings.Conversation_ForwardAuthorHiddenTooltip, self, self.avatarNode.frame)
|
self.controllerInteraction?.displayMessageTooltip(id, self.presentationData.strings.Conversation_ForwardAuthorHiddenTooltip, self, self.avatarNode.frame)
|
||||||
} else if let peer = self.peer {
|
} else if let peer = self.peer {
|
||||||
if let adMessageId = self.adMessageId {
|
if let adMessageId = self.adMessageId {
|
||||||
self.controllerInteraction?.activateAdAction(adMessageId)
|
self.controllerInteraction?.activateAdAction(adMessageId, nil)
|
||||||
} else {
|
} else {
|
||||||
if let channel = peer as? TelegramChannel, case .broadcast = channel.info {
|
if let channel = peer as? TelegramChannel, case .broadcast = channel.info {
|
||||||
self.controllerInteraction?.openPeer(EnginePeer(peer), .chat(textInputState: nil, subject: nil, peekData: nil), self.messageReference, .default)
|
self.controllerInteraction?.openPeer(EnginePeer(peer), .chat(textInputState: nil, subject: nil, peekData: nil), self.messageReference, .default)
|
||||||
|
@ -140,7 +140,7 @@ public final class ChatMessageWebpageBubbleContentNode: ChatMessageBubbleContent
|
|||||||
self.contentNode.activateAction = { [weak self] in
|
self.contentNode.activateAction = { [weak self] in
|
||||||
if let strongSelf = self, let item = strongSelf.item {
|
if let strongSelf = self, let item = strongSelf.item {
|
||||||
if let _ = item.message.adAttribute {
|
if let _ = item.message.adAttribute {
|
||||||
item.controllerInteraction.activateAdAction(item.message.id)
|
item.controllerInteraction.activateAdAction(item.message.id, strongSelf.contentNode.makeProgress())
|
||||||
} else {
|
} else {
|
||||||
var webPageContent: TelegramMediaWebpageLoadedContent?
|
var webPageContent: TelegramMediaWebpageLoadedContent?
|
||||||
for media in item.message.media {
|
for media in item.message.media {
|
||||||
|
@ -604,7 +604,7 @@ final class ChatRecentActionsControllerNode: ViewControllerTracingNode {
|
|||||||
}, openLargeEmojiInfo: { _, _, _ in
|
}, openLargeEmojiInfo: { _, _, _ in
|
||||||
}, openJoinLink: { _ in
|
}, openJoinLink: { _ in
|
||||||
}, openWebView: { _, _, _, _ in
|
}, openWebView: { _, _, _, _ in
|
||||||
}, activateAdAction: { _ in
|
}, activateAdAction: { _, _ in
|
||||||
}, openRequestedPeerSelection: { _, _, _, _ in
|
}, openRequestedPeerSelection: { _, _, _, _ in
|
||||||
}, saveMediaToFiles: { _ in
|
}, saveMediaToFiles: { _ in
|
||||||
}, openNoAdsDemo: {
|
}, openNoAdsDemo: {
|
||||||
|
@ -232,7 +232,7 @@ public final class ChatControllerInteraction: ChatControllerInteractionProtocol
|
|||||||
public let openLargeEmojiInfo: (String, String?, TelegramMediaFile) -> Void
|
public let openLargeEmojiInfo: (String, String?, TelegramMediaFile) -> Void
|
||||||
public let openJoinLink: (String) -> Void
|
public let openJoinLink: (String) -> Void
|
||||||
public let openWebView: (String, String, Bool, ChatOpenWebViewSource) -> Void
|
public let openWebView: (String, String, Bool, ChatOpenWebViewSource) -> Void
|
||||||
public let activateAdAction: (EngineMessage.Id) -> Void
|
public let activateAdAction: (EngineMessage.Id, Promise<Bool>?) -> Void
|
||||||
public let openRequestedPeerSelection: (EngineMessage.Id, ReplyMarkupButtonRequestPeerType, Int32, Int32) -> Void
|
public let openRequestedPeerSelection: (EngineMessage.Id, ReplyMarkupButtonRequestPeerType, Int32, Int32) -> Void
|
||||||
public let saveMediaToFiles: (EngineMessage.Id) -> Void
|
public let saveMediaToFiles: (EngineMessage.Id) -> Void
|
||||||
public let openNoAdsDemo: () -> Void
|
public let openNoAdsDemo: () -> Void
|
||||||
@ -357,7 +357,7 @@ public final class ChatControllerInteraction: ChatControllerInteractionProtocol
|
|||||||
openLargeEmojiInfo: @escaping (String, String?, TelegramMediaFile) -> Void,
|
openLargeEmojiInfo: @escaping (String, String?, TelegramMediaFile) -> Void,
|
||||||
openJoinLink: @escaping (String) -> Void,
|
openJoinLink: @escaping (String) -> Void,
|
||||||
openWebView: @escaping (String, String, Bool, ChatOpenWebViewSource) -> Void,
|
openWebView: @escaping (String, String, Bool, ChatOpenWebViewSource) -> Void,
|
||||||
activateAdAction: @escaping (EngineMessage.Id) -> Void,
|
activateAdAction: @escaping (EngineMessage.Id, Promise<Bool>?) -> Void,
|
||||||
openRequestedPeerSelection: @escaping (EngineMessage.Id, ReplyMarkupButtonRequestPeerType, Int32, Int32) -> Void,
|
openRequestedPeerSelection: @escaping (EngineMessage.Id, ReplyMarkupButtonRequestPeerType, Int32, Int32) -> Void,
|
||||||
saveMediaToFiles: @escaping (EngineMessage.Id) -> Void,
|
saveMediaToFiles: @escaping (EngineMessage.Id) -> Void,
|
||||||
openNoAdsDemo: @escaping () -> Void,
|
openNoAdsDemo: @escaping () -> Void,
|
||||||
|
@ -3316,7 +3316,7 @@ final class PeerInfoScreenNode: ViewControllerTracingNode, PeerInfoScreenNodePro
|
|||||||
}, openLargeEmojiInfo: { _, _, _ in
|
}, openLargeEmojiInfo: { _, _, _ in
|
||||||
}, openJoinLink: { _ in
|
}, openJoinLink: { _ in
|
||||||
}, openWebView: { _, _, _, _ in
|
}, openWebView: { _, _, _, _ in
|
||||||
}, activateAdAction: { _ in
|
}, activateAdAction: { _, _ in
|
||||||
}, openRequestedPeerSelection: { _, _, _, _ in
|
}, openRequestedPeerSelection: { _, _, _, _ in
|
||||||
}, saveMediaToFiles: { _ in
|
}, saveMediaToFiles: { _ in
|
||||||
}, openNoAdsDemo: {
|
}, openNoAdsDemo: {
|
||||||
|
@ -4095,12 +4095,12 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
|||||||
strongSelf.present(controller, in: .window(.root))
|
strongSelf.present(controller, in: .window(.root))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}, activateAdAction: { [weak self] messageId in
|
}, activateAdAction: { [weak self] messageId, progress in
|
||||||
guard let self, let message = self.chatDisplayNode.historyNode.messageInCurrentHistoryView(messageId), let adAttribute = message.adAttribute else {
|
guard let self, let message = self.chatDisplayNode.historyNode.messageInCurrentHistoryView(messageId), let adAttribute = message.adAttribute else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
self.chatDisplayNode.historyNode.adMessagesContext?.markAction(opaqueId: adAttribute.opaqueId)
|
self.chatDisplayNode.historyNode.adMessagesContext?.markAction(opaqueId: adAttribute.opaqueId)
|
||||||
self.controllerInteraction?.openUrl(ChatControllerInteraction.OpenUrl(url: adAttribute.url, concealed: false, external: true))
|
self.controllerInteraction?.openUrl(ChatControllerInteraction.OpenUrl(url: adAttribute.url, concealed: false, external: true, progress: progress))
|
||||||
}, openRequestedPeerSelection: { [weak self] messageId, peerType, buttonId, maxQuantity in
|
}, openRequestedPeerSelection: { [weak self] messageId, peerType, buttonId, maxQuantity in
|
||||||
guard let self else {
|
guard let self else {
|
||||||
return
|
return
|
||||||
|
@ -1759,7 +1759,7 @@ public final class SharedAccountContextImpl: SharedAccountContext {
|
|||||||
}, openLargeEmojiInfo: { _, _, _ in
|
}, openLargeEmojiInfo: { _, _, _ in
|
||||||
}, openJoinLink: { _ in
|
}, openJoinLink: { _ in
|
||||||
}, openWebView: { _, _, _, _ in
|
}, openWebView: { _, _, _, _ in
|
||||||
}, activateAdAction: { _ in
|
}, activateAdAction: { _, _ in
|
||||||
}, openRequestedPeerSelection: { _, _, _, _ in
|
}, openRequestedPeerSelection: { _, _, _, _ in
|
||||||
}, saveMediaToFiles: { _ in
|
}, saveMediaToFiles: { _ in
|
||||||
}, openNoAdsDemo: {
|
}, openNoAdsDemo: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user