2021-07-26 14:09:23 +02:00
|
|
|
//
|
|
|
|
// IntentHandler.swift
|
|
|
|
// MastodonIntent
|
|
|
|
//
|
|
|
|
// Created by Cirno MainasuK on 2021-7-26.
|
|
|
|
//
|
|
|
|
|
|
|
|
import Intents
|
2024-07-18 11:53:47 +02:00
|
|
|
import MastodonCore
|
2021-07-26 14:09:23 +02:00
|
|
|
|
|
|
|
class IntentHandler: INExtension {
|
|
|
|
|
2024-10-30 19:38:21 +01:00
|
|
|
@MainActor
|
2021-07-26 14:09:23 +02:00
|
|
|
override func handler(for intent: INIntent) -> Any {
|
2024-10-30 17:26:51 +01:00
|
|
|
AuthenticationServiceProvider.shared.prepareForUse()
|
2024-07-18 11:53:47 +02:00
|
|
|
|
2021-07-26 14:09:23 +02:00
|
|
|
switch intent {
|
|
|
|
case is SendPostIntent:
|
|
|
|
return SendPostIntentHandler()
|
2023-01-24 11:14:50 +01:00
|
|
|
case is FollowersCountIntent:
|
|
|
|
return FollowersCountIntentHandler()
|
2023-01-31 14:55:59 +01:00
|
|
|
case is MultiFollowersCountIntent:
|
2023-01-31 14:37:49 +01:00
|
|
|
return MultiFollowersCountIntentHandler()
|
2023-03-27 22:41:36 +02:00
|
|
|
case is HashtagIntent:
|
|
|
|
return HashtagIntentHandler()
|
2021-07-26 14:09:23 +02:00
|
|
|
default:
|
|
|
|
return self
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|