mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-10-09 03:20:48 +00:00
Add tg://privatepost url handling
This commit is contained in:
parent
c13a2d6899
commit
9b4f576e77
@ -581,6 +581,25 @@ func openExternalUrlImpl(context: AccountContext, urlContext: OpenURLContext, ur
|
||||
convertedUrl = "https://t.me/addtheme/\(parameter)"
|
||||
}
|
||||
}
|
||||
} else if parsedUrl.host == "privatepost" {
|
||||
if let components = URLComponents(string: "/?" + query) {
|
||||
var channelId: Int64?
|
||||
var postId: Int32?
|
||||
if let queryItems = components.queryItems {
|
||||
for queryItem in queryItems {
|
||||
if let value = queryItem.value {
|
||||
if queryItem.name == "channel" {
|
||||
channelId = Int64(value)
|
||||
} else if queryItem.name == "post" {
|
||||
postId = Int32(value)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if let channelId = channelId, let postId = postId {
|
||||
convertedUrl = "https://t.me/c/\(channelId)/\(postId)"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if parsedUrl.host == "resolve" {
|
||||
|
Loading…
x
Reference in New Issue
Block a user