mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Force external for video ads
This commit is contained in:
@@ -386,7 +386,7 @@ public func galleryItemForEntry(
|
||||
}
|
||||
}
|
||||
if content == nil, let webEmbedContent = WebEmbedVideoContent(userLocation: .peer(message.id.peerId), webPage: webpage, webpageContent: webpageContent, forcedTimestamp: timecode.flatMap(Int.init), openUrl: { url in
|
||||
performAction(.url(url: url.absoluteString, concealed: false, dismiss: true))
|
||||
performAction(.url(url: url.absoluteString, concealed: false, forceExternal: false, dismiss: true))
|
||||
}) {
|
||||
content = webEmbedContent
|
||||
}
|
||||
@@ -504,7 +504,7 @@ private enum GalleryMessageHistoryView {
|
||||
}
|
||||
|
||||
public enum GalleryControllerInteractionTapAction {
|
||||
case url(url: String, concealed: Bool, dismiss: Bool)
|
||||
case url(url: String, concealed: Bool, forceExternal: Bool, dismiss: Bool)
|
||||
case textMention(String)
|
||||
case peerMention(PeerId, String)
|
||||
case botCommand(String)
|
||||
@@ -960,14 +960,14 @@ public class GalleryController: ViewController, StandalonePresentableController,
|
||||
|
||||
performActionImpl = { [weak self] action in
|
||||
if let strongSelf = self {
|
||||
if case let .url(_, _, dismiss) = action, !dismiss {
|
||||
if case let .url(_, _, _, dismiss) = action, !dismiss {
|
||||
} else if case .timecode = action {
|
||||
} else {
|
||||
strongSelf.dismiss(forceAway: false)
|
||||
}
|
||||
switch action {
|
||||
case let .url(url, concealed, _):
|
||||
strongSelf.actionInteraction?.openUrl(url, concealed)
|
||||
case let .url(url, concealed, forceExternal, _):
|
||||
strongSelf.actionInteraction?.openUrl(url, concealed, forceExternal)
|
||||
case let .textMention(mention):
|
||||
strongSelf.actionInteraction?.openPeerMention(mention)
|
||||
case let .peerMention(peerId, _):
|
||||
@@ -996,7 +996,7 @@ public class GalleryController: ViewController, StandalonePresentableController,
|
||||
presentationData = presentationData.withUpdated(theme: defaultDarkColorPresentationTheme)
|
||||
}
|
||||
switch action {
|
||||
case let .url(url, _, _):
|
||||
case let .url(url, _, forceExternal, _):
|
||||
var cleanUrl = url
|
||||
var canAddToReadingList = true
|
||||
let canOpenIn = availableOpenInOptions(context: strongSelf.context, item: .url(url: url)).count > 1
|
||||
@@ -1031,7 +1031,7 @@ public class GalleryController: ViewController, StandalonePresentableController,
|
||||
strongSelf.actionInteraction?.openUrlIn(url)
|
||||
} else {
|
||||
strongSelf.dismiss(forceAway: false)
|
||||
strongSelf.actionInteraction?.openUrl(url, false)
|
||||
strongSelf.actionInteraction?.openUrl(url, false, forceExternal)
|
||||
}
|
||||
}
|
||||
}))
|
||||
|
||||
Reference in New Issue
Block a user