Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Target SiriIntents: Split IntentHandler into smaller files (#6203) #6365

Merged
merged 18 commits into from
Jul 6, 2022
Merged
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
2c44e1b
Add protocol `ContactResolving`
wtimme Jun 30, 2022
0fda5d7
Let the `IntentHandler` implement `ContactResolving` (#6203)
wtimme Jun 30, 2022
02a56db
Prepare the separation of the contact resolver from the intents handl…
wtimme Jun 30, 2022
f414324
Move the implementation of `ContactResolving` to a dedicated class (#…
wtimme Jun 30, 2022
c21e8e3
Move `ContactResolver` to a dedicated file (#6203)
wtimme Jun 30, 2022
0880e91
Prepare the separation of the `StartAudioCallIntentHandler` from `Int…
wtimme Jun 30, 2022
6977afb
Move the implementation of `INStartAudioCallIntentHandling` to a dedi…
wtimme Jun 30, 2022
6abb4ff
Prepare the separation of the `StartVideoCallIntentHandler` from `Int…
wtimme Jun 30, 2022
6ca57b6
Move the implementation of `INStartVideoCallIntentHandling` to a dedi…
wtimme Jun 30, 2022
52114cc
Prepare the separation of the `SendMessageIntentHandler` from `Intent…
wtimme Jun 30, 2022
4507b66
Move the implementation of `INSendMessageIntentHandling` to a dedicat…
wtimme Jun 30, 2022
e4b12b9
Remove unused property (#6203)
wtimme Jun 30, 2022
3a3b1a9
Return `nil` if the requested intent cannot be handled (#6203)
wtimme Jun 30, 2022
b6ff75b
Initialize the intent handlers _after_ everything else is configured …
wtimme Jun 30, 2022
5a63be1
Add changelog entry
wtimme Jun 30, 2022
3ac7f0a
Move curly braces in Objective-C to dedicated lines
wtimme Jul 2, 2022
4cf16e9
Inject the `ContactResolver` into the intent handlers during initiali…
wtimme Jul 5, 2022
6e761f8
Prefer forward-declaration over import in Objective-C header files
wtimme Jul 5, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Prepare the separation of the contact resolver from the intents handl…
…er (#6203)
  • Loading branch information
wtimme committed Jun 30, 2022
commit 02a56db368ce846a927a018646cb885c41b5c60a
10 changes: 7 additions & 3 deletions SiriIntents/IntentHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ @interface IntentHandler () <INStartAudioCallIntentHandling, INStartVideoCallInt
*/
@property (nonatomic) MXRoom *selectedRoom;

@property (nonatomic) id<ContactResolving> contactResolver;

@end

@interface IntentHandler (ContactResolving) <ContactResolving>
Expand All @@ -46,6 +48,8 @@ - (instancetype)init
self = [super init];
if (self)
{
_contactResolver = self;

// Set static application settings
_configuration = [CommonConfiguration new];
[_configuration setupSettings];
Expand Down Expand Up @@ -81,7 +85,7 @@ - (id)handlerForIntent:(INIntent *)intent

- (void)resolveContactsForStartAudioCall:(INStartAudioCallIntent *)intent withCompletion:(void (^)(NSArray<INPersonResolutionResult *> * _Nonnull))completion
{
[self resolveContacts:intent.contacts withCompletion:completion];
[self.contactResolver resolveContacts:intent.contacts withCompletion:completion];
}

- (void)confirmStartAudioCall:(INStartAudioCallIntent *)intent completion:(void (^)(INStartAudioCallIntentResponse * _Nonnull))completion
Expand Down Expand Up @@ -132,7 +136,7 @@ - (void)handleStartAudioCall:(INStartAudioCallIntent *)intent completion:(void (

- (void)resolveContactsForStartVideoCall:(INStartVideoCallIntent *)intent withCompletion:(void (^)(NSArray<INPersonResolutionResult *> * _Nonnull))completion
{
[self resolveContacts:intent.contacts withCompletion:completion];
[self.contactResolver resolveContacts:intent.contacts withCompletion:completion];
}

- (void)confirmStartVideoCall:(INStartVideoCallIntent *)intent completion:(void (^)(INStartVideoCallIntentResponse * _Nonnull))completion
Expand Down Expand Up @@ -183,7 +187,7 @@ - (void)handleStartVideoCall:(INStartVideoCallIntent *)intent completion:(void (

- (void)resolveRecipientsForSendMessage:(INSendMessageIntent *)intent completion:(void (^)(NSArray<INSendMessageRecipientResolutionResult *> * _Nonnull))completion
{
[self resolveContacts:intent.recipients withCompletion:completion];
[self.contactResolver resolveContacts:intent.recipients withCompletion:completion];
}

- (void)resolveContentForSendMessage:(INSendMessageIntent *)intent withCompletion:(void (^)(INStringResolutionResult * _Nonnull))completion
Expand Down