Add more instant view prefixes

This commit is contained in:
Ali 2021-11-06 02:40:51 +04:00
parent 11ae567544
commit 4aea7f96d7
2 changed files with 20 additions and 1 deletions

View File

@ -10,7 +10,14 @@ import TelegramNotices
import AccountContext
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 {
case botStart(String)

View File

@ -9,6 +9,18 @@ public func isConcealedUrlWhitelisted(_ url: URL) -> Bool {
if let host = url.host, whitelistedHosts.contains(host) {
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
}