63c09565f2
Signed-off-by: Alessio Nossa <alessio.nossa@gmail.com>
23 lines
560 B
Swift
23 lines
560 B
Swift
// SPDX-License-Identifier: MIT
|
|
// Copyright © 2018-2021 WireGuard LLC. All Rights Reserved.
|
|
|
|
import Intents
|
|
|
|
class IntentHandler: INExtension {
|
|
|
|
override init() {
|
|
super.init()
|
|
Logger.configureGlobal(tagged: "INTENTS", withFilePath: FileManager.logFileURL?.path)
|
|
}
|
|
|
|
override func handler(for intent: INIntent) -> Any {
|
|
guard intent is GetPeersIntent ||
|
|
intent is UpdateConfigurationIntent else {
|
|
fatalError("Unhandled intent type: \(intent)")
|
|
}
|
|
|
|
return IntentHandling()
|
|
}
|
|
|
|
}
|