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