Skip to content

Commit

Permalink
allow to open http-proxy-links in browser
Browse files Browse the repository at this point in the history
http-proxies are identified by having a port number;
this is not the case for most http-pages.

however, if the guessing can be wrong,
always offer to open the browser alternatively

counterpart of deltachat/deltachat-android#3435
feature proposal at: https://support.delta.chat/t/in-the-new-android-client-it-is-not-possible-to-click-to-open-urls-with-port-numbers/3327
  • Loading branch information
r10s committed Nov 20, 2024
1 parent 9372141 commit 52be60d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions deltachat-ios/Coordinator/AppCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,14 @@ class AppCoordinator: NSObject {

selectAlert.addAction(cancelAction)
selectAlert.addAction(selectAction)
if proxyURL.starts(with: "http") {
selectAlert.addAction(UIAlertAction(title: String.localized("open"), style: .default) { [weak self] _ in
guard let self else { return }

Check warning on line 224 in deltachat-ios/Coordinator/AppCoordinator.swift

View workflow job for this annotation

GitHub Actions / build

value 'self' was defined but never used; consider replacing with boolean test
if let url = URL(string: proxyURL) {
UIApplication.shared.open(url)
}
})
}

viewController.present(selectAlert, animated: true)
}
Expand Down

0 comments on commit 52be60d

Please sign in to comment.