From 06e2659eb1470bfebe67436c0a3913f1cb1a825c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=BCller?= Date: Mon, 10 Jul 2023 10:51:26 +0200 Subject: [PATCH] Make sure confirmationViewController is dismissed after send message donation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcel Müller --- NextcloudTalk/NCIntentController.m | 3 ++- ShareExtension/ShareConfirmationViewController.m | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/NextcloudTalk/NCIntentController.m b/NextcloudTalk/NCIntentController.m index 9b77f4d9b..b0744a808 100644 --- a/NextcloudTalk/NCIntentController.m +++ b/NextcloudTalk/NCIntentController.m @@ -119,7 +119,8 @@ - (void)donateSendMessageIntentForRoom:(NCRoom *)room image = [[AvatarManager shared] createRenderedImageWithImage:image]; } - [sendMessageIntent setImage:[INImage imageWithUIImage:image] forParameterNamed:@"speakableGroupName"]; + INImage *intentImage = [INImage imageWithUIImage:image]; + [sendMessageIntent setImage:intentImage forParameterNamed:@"speakableGroupName"]; [self donateMessageSentIntent:sendMessageIntent]; } }]; diff --git a/ShareExtension/ShareConfirmationViewController.m b/ShareExtension/ShareConfirmationViewController.m index fa94e94b2..1524ab60c 100644 --- a/ShareExtension/ShareConfirmationViewController.m +++ b/ShareExtension/ShareConfirmationViewController.m @@ -372,11 +372,11 @@ - (void)sendSharedText { [[NCAPIController sharedInstance] sendChatMessage:self.shareTextView.text toRoom:_room.token displayName:nil replyTo:-1 referenceId:nil silently:NO forAccount:_account withCompletionBlock:^(NSError *error) { if (error) { - [self.delegate shareConfirmationViewControllerDidFailed:self]; NSLog(@"Failed to send shared item"); + [self.delegate shareConfirmationViewControllerDidFailed:self]; } else { - [self.delegate shareConfirmationViewControllerDidFinish:self]; [[NCIntentController sharedInstance] donateSendMessageIntentForRoom:self->_room]; + [self.delegate shareConfirmationViewControllerDidFinish:self]; } [self stopAnimatingSharingIndicator]; }];