WireguardApp: iOS: Added Siri shortcuts donations for SetTunnelStatus intent
Signed-off-by: Alessio Nossa <alessio.nossa@gmail.com>
This commit is contained in:
@@ -5,6 +5,10 @@ import Foundation
|
||||
import NetworkExtension
|
||||
import os.log
|
||||
|
||||
#if os(iOS)
|
||||
import Intents
|
||||
#endif
|
||||
|
||||
protocol TunnelsManagerListDelegate: AnyObject {
|
||||
func tunnelAdded(at index: Int)
|
||||
func tunnelModified(at index: Int)
|
||||
@@ -307,6 +311,12 @@ class TunnelsManager {
|
||||
}
|
||||
#elseif os(iOS)
|
||||
(tunnelProviderManager.protocolConfiguration as? NETunnelProviderProtocol)?.destroyConfigurationReference()
|
||||
|
||||
INInteraction.delete(with: "com.wireguard.intents.tunnel.\(tunnel.name)") { error in
|
||||
if let error = error {
|
||||
wg_log(.error, message: "Error deleting donated interactions for tunnel \(tunnel.name): \(error.localizedDescription)")
|
||||
}
|
||||
}
|
||||
#else
|
||||
#error("Unimplemented")
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user