|
|
@ -297,31 +297,8 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
|
|
|
|
|
|
#pragma mark - Editing
|
|
|
|
#pragma mark - Editing
|
|
|
|
|
|
|
|
|
|
|
|
- (void)presentContactViewControllerForRecipientId:(NSString *)recipientId
|
|
|
|
- (void)presentMissingContactAccessAlertControllerFromViewController:(UIViewController *)viewController
|
|
|
|
fromViewController:(UIViewController<ContactEditingDelegate> *)fromViewController
|
|
|
|
|
|
|
|
editImmediately:(BOOL)shouldEditImmediately
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
[self presentContactViewControllerForRecipientId:recipientId
|
|
|
|
|
|
|
|
fromViewController:fromViewController
|
|
|
|
|
|
|
|
editImmediately:shouldEditImmediately
|
|
|
|
|
|
|
|
addToExistingCnContact:nil];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- (void)presentContactViewControllerForRecipientId:(NSString *)recipientId
|
|
|
|
|
|
|
|
fromViewController:(UIViewController<ContactEditingDelegate> *)fromViewController
|
|
|
|
|
|
|
|
editImmediately:(BOOL)shouldEditImmediately
|
|
|
|
|
|
|
|
addToExistingCnContact:(CNContact *_Nullable)addToExistingCnContact
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
SignalAccount *signalAccount = [self signalAccountForRecipientId:recipientId];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!self.contactsManager.supportsContactEditing) {
|
|
|
|
|
|
|
|
DDLogError(@"%@ Contact editing not supported.", self.tag);
|
|
|
|
|
|
|
|
// Should not expose UI that lets the user get here.
|
|
|
|
|
|
|
|
OWSAssert(NO);
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!self.contactsManager.isSystemContactsAuthorized) {
|
|
|
|
|
|
|
|
UIAlertController *alertController = [UIAlertController
|
|
|
|
UIAlertController *alertController = [UIAlertController
|
|
|
|
alertControllerWithTitle:NSLocalizedString(@"EDIT_CONTACT_WITHOUT_CONTACTS_PERMISSION_ALERT_TITLE", comment
|
|
|
|
alertControllerWithTitle:NSLocalizedString(@"EDIT_CONTACT_WITHOUT_CONTACTS_PERMISSION_ALERT_TITLE", comment
|
|
|
|
: @"Alert title for when the user has just tried to edit a "
|
|
|
|
: @"Alert title for when the user has just tried to edit a "
|
|
|
@ -346,7 +323,35 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
[[UIApplication sharedApplication] openSystemSettings];
|
|
|
|
[[UIApplication sharedApplication] openSystemSettings];
|
|
|
|
}]];
|
|
|
|
}]];
|
|
|
|
|
|
|
|
|
|
|
|
[fromViewController presentViewController:alertController animated:YES completion:nil];
|
|
|
|
[viewController presentViewController:alertController animated:YES completion:nil];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- (void)presentContactViewControllerForRecipientId:(NSString *)recipientId
|
|
|
|
|
|
|
|
fromViewController:(UIViewController<ContactEditingDelegate> *)fromViewController
|
|
|
|
|
|
|
|
editImmediately:(BOOL)shouldEditImmediately
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
[self presentContactViewControllerForRecipientId:recipientId
|
|
|
|
|
|
|
|
fromViewController:fromViewController
|
|
|
|
|
|
|
|
editImmediately:shouldEditImmediately
|
|
|
|
|
|
|
|
addToExistingCnContact:nil];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- (void)presentContactViewControllerForRecipientId:(NSString *)recipientId
|
|
|
|
|
|
|
|
fromViewController:(UIViewController<ContactEditingDelegate> *)fromViewController
|
|
|
|
|
|
|
|
editImmediately:(BOOL)shouldEditImmediately
|
|
|
|
|
|
|
|
addToExistingCnContact:(CNContact *_Nullable)addToExistingCnContact
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
SignalAccount *signalAccount = [self signalAccountForRecipientId:recipientId];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!self.contactsManager.supportsContactEditing) {
|
|
|
|
|
|
|
|
DDLogError(@"%@ Contact editing not supported.", self.tag);
|
|
|
|
|
|
|
|
// Should not expose UI that lets the user get here.
|
|
|
|
|
|
|
|
OWSAssert(NO);
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!self.contactsManager.isSystemContactsAuthorized) {
|
|
|
|
|
|
|
|
[self presentMissingContactAccessAlertControllerFromViewController:fromViewController];
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|