mirror of
https://github.com/passepartoutvpn/passepartout-apple.git
synced 2025-01-18 22:49:10 +00:00
Donate interactions
- Connect on add profile (covers first profile) - Connect on activate profile - Disable on connect to VPN - Trust on add current Wi-Fi - Trust on cellular network - MoveTo on first connected location (if provider) - MoveTo on location change (if provider)
This commit is contained in:
parent
2e4d2162ac
commit
5d2450b985
@ -471,6 +471,10 @@ extension OrganizerViewController: ConnectionServiceDelegate {
|
||||
reloadModel()
|
||||
tableView.reloadData()
|
||||
|
||||
if #available(iOS 12, *) {
|
||||
InteractionsHandler.donateConnectVPN(with: profile)
|
||||
}
|
||||
|
||||
// XXX: hack around bad replace when detail presented in compact view
|
||||
if let detailNav = navigationController?.viewControllers.last as? UINavigationController {
|
||||
var existingServiceVC: ServiceViewController?
|
||||
@ -513,5 +517,9 @@ extension OrganizerViewController: ConnectionServiceDelegate {
|
||||
TransientStore.shared.serialize(withProfiles: false) // activate
|
||||
|
||||
tableView.reloadData()
|
||||
|
||||
if #available(iOS 12, *) {
|
||||
InteractionsHandler.donateConnectVPN(with: profile)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -243,12 +243,24 @@ class ServiceViewController: UIViewController, TableModelHost {
|
||||
self.reloadModel()
|
||||
self.tableView.reloadData()
|
||||
}
|
||||
|
||||
if #available(iOS 12, *) {
|
||||
InteractionsHandler.donateDisableVPN()
|
||||
}
|
||||
} else {
|
||||
vpn.disconnect { (error) in
|
||||
self.reloadModel()
|
||||
self.tableView.reloadData()
|
||||
}
|
||||
}
|
||||
|
||||
if #available(iOS 12, *) {
|
||||
if let provider = profile as? ProviderConnectionProfile, let pool = provider.pool {
|
||||
InteractionsHandler.donateMoveToLocation(with: provider, pool: pool)
|
||||
} else {
|
||||
InteractionsHandler.donateConnectVPN(with: uncheckedProfile)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private func confirmVpnReconnection() {
|
||||
@ -763,6 +775,11 @@ extension ServiceViewController: UITableViewDataSource, UITableViewDelegate, Tog
|
||||
return true
|
||||
|
||||
case .trustedAddCurrentWiFi:
|
||||
if #available(iOS 12, *) {
|
||||
InteractionsHandler.donateTrustCurrentNetwork()
|
||||
InteractionsHandler.donateUntrustCurrentNetwork()
|
||||
}
|
||||
|
||||
guard trustedNetworks.addCurrentWifi() else {
|
||||
let alert = Macros.alert(
|
||||
L10n.Service.Sections.Trusted.header,
|
||||
@ -807,6 +824,11 @@ extension ServiceViewController: UITableViewDataSource, UITableViewDelegate, Tog
|
||||
toggleDisconnectsOnSleep(cell.isOn)
|
||||
|
||||
case .trustedMobile:
|
||||
if #available(iOS 12, *) {
|
||||
InteractionsHandler.donateTrustCellularNetwork()
|
||||
InteractionsHandler.donateUntrustCellularNetwork()
|
||||
}
|
||||
|
||||
trustedNetworks.setMobile(cell.isOn)
|
||||
|
||||
case .trustedWiFi:
|
||||
@ -1066,6 +1088,10 @@ extension ServiceViewController: ProviderPoolViewControllerDelegate {
|
||||
uncheckedProviderProfile.poolId = pool.id
|
||||
reloadSelectedRow(andRowAt: endpointIndexPath)
|
||||
vpn.reinstallIfEnabled()
|
||||
|
||||
if #available(iOS 12, *) {
|
||||
InteractionsHandler.donateMoveToLocation(with: uncheckedProviderProfile, pool: pool)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user