mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Add more instant view prefixes
This commit is contained in:
parent
11ae567544
commit
4aea7f96d7
@ -10,7 +10,14 @@ import TelegramNotices
|
|||||||
import AccountContext
|
import AccountContext
|
||||||
|
|
||||||
private let baseTelegramMePaths = ["telegram.me", "t.me", "telegram.dog"]
|
private let baseTelegramMePaths = ["telegram.me", "t.me", "telegram.dog"]
|
||||||
private let baseTelegraPhPaths = ["telegra.ph/", "te.legra.ph/", "graph.org/", "t.me/iv?"]
|
private let baseTelegraPhPaths = [
|
||||||
|
"telegra.ph/",
|
||||||
|
"te.legra.ph/",
|
||||||
|
"graph.org/",
|
||||||
|
"t.me/iv?",
|
||||||
|
"telegram.org/blog/",
|
||||||
|
"telegram.org/tour/"
|
||||||
|
]
|
||||||
|
|
||||||
public enum ParsedInternalPeerUrlParameter {
|
public enum ParsedInternalPeerUrlParameter {
|
||||||
case botStart(String)
|
case botStart(String)
|
||||||
|
@ -9,6 +9,18 @@ public func isConcealedUrlWhitelisted(_ url: URL) -> Bool {
|
|||||||
if let host = url.host, whitelistedHosts.contains(host) {
|
if let host = url.host, whitelistedHosts.contains(host) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
if let host = url.host, host == "telegram.org" {
|
||||||
|
let whitelistedNativePrefixes: Set<String> = Set([
|
||||||
|
"/blog/",
|
||||||
|
"/tour/"
|
||||||
|
])
|
||||||
|
|
||||||
|
for nativePrefix in whitelistedNativePrefixes {
|
||||||
|
if url.path.starts(with: nativePrefix) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user