2024-05-02 09:32:19 +02:00
|
|
|
import Foundation
|
|
|
|
import AppIntents
|
|
|
|
|
|
|
|
struct PostIntent: AppIntent {
|
2024-05-02 11:37:38 +02:00
|
|
|
static let title: LocalizedStringResource = "Post status to Mastodon"
|
2024-05-02 09:32:19 +02:00
|
|
|
static var description: IntentDescription {
|
|
|
|
get {
|
2024-05-02 11:37:38 +02:00
|
|
|
"Use Ice Cubes to post a status to Mastodon"
|
2024-05-02 09:32:19 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
static let openAppWhenRun: Bool = true
|
|
|
|
|
2024-05-02 12:05:48 +02:00
|
|
|
@Parameter(title: "Post content", inputConnectionBehavior: .connectToPreviousIntentResult)
|
2024-05-02 09:32:19 +02:00
|
|
|
var content: String?
|
|
|
|
|
|
|
|
func perform() async throws -> some IntentResult {
|
|
|
|
AppIntentService.shared.handledIntent = .init(intent: self)
|
|
|
|
return .result()
|
|
|
|
}
|
|
|
|
}
|