Removed SetTunnelStatus

Signed-off-by: Alessio Nossa <alessio.nossa@gmail.com>
This commit is contained in:
Alessio Nossa
2023-04-01 16:00:24 +02:00
parent c29787f898
commit 63c09565f2
7 changed files with 4 additions and 452 deletions
@@ -2,7 +2,6 @@
// Copyright © 2018-2021 WireGuard LLC. All Rights Reserved.
import UIKit
import Intents
class MainViewController: UISplitViewController {
@@ -97,25 +96,10 @@ extension MainViewController {
if let tunnel = tunnelsManager.tunnel(named: tunnelName) {
tunnelsListVC.showTunnelDetail(for: tunnel, animated: false)
if shouldToggleStatus {
let intent = SetTunnelStatusIntent()
intent.tunnel = tunnel.name
intent.operation = .turn
if tunnel.status == .inactive {
tunnelsManager.startActivation(of: tunnel)
intent.state = .on
} else if tunnel.status == .active {
tunnelsManager.startDeactivation(of: tunnel)
intent.state = .off
}
let interaction = INInteraction(intent: intent, response: nil)
interaction.groupIdentifier = "com.wireguard.intents.tunnel.\(tunnel.name)"
interaction.donate { error in
if let error = error {
wg_log(.error, message: "Error donating interaction for SetTunnelStatusIntent: \(error.localizedDescription)")
}
}
}
}