diff --git a/Signal/src/ViewControllers/MessagesViewController.m b/Signal/src/ViewControllers/MessagesViewController.m index 28f587515..94c7f0d01 100644 --- a/Signal/src/ViewControllers/MessagesViewController.m +++ b/Signal/src/ViewControllers/MessagesViewController.m @@ -1583,6 +1583,7 @@ typedef enum : NSUInteger { } - (void)showConfirmIdentityUIForRecipientIdentity:(OWSRecipientIdentity *)recipientIdentity + confirmationText:(NSString *)confirmationText completion:(void (^)(BOOL didConfirmedIdentity))completionHandler { NSString *displayName = [self.contactsManager displayNameForPhoneIdentifier:recipientIdentity.recipientId]; @@ -1603,9 +1604,7 @@ typedef enum : NSUInteger { [actionSheet addAction:[UIAlertAction - actionWithTitle: - NSLocalizedString(@"SAFETY_NUMBER_CHANGED_CONFIRM_SEND_ACTION", - @"button title to confirm sending to a recipient whose safety number recently changed") + actionWithTitle:confirmationText style:UIAlertActionStyleDefault handler:^(UIAlertAction *_Nonnull action) { DDLogInfo(@"%@ Confirmed sending identity: %@", self.tag, recipientIdentity); @@ -1688,6 +1687,22 @@ typedef enum : NSUInteger { return; } + OWSRecipientIdentity *unconfirmedIdentityThatShouldBlockSending = [self unconfirmedIdentityThatShouldBlockSending]; + if (unconfirmedIdentityThatShouldBlockSending != nil) { + __weak MessagesViewController *weakSelf = self; + [self showConfirmIdentityUIForRecipientIdentity:unconfirmedIdentityThatShouldBlockSending + confirmationText:NSLocalizedString(@"SAFETY_NUMBER_CHANGED_CONFIRM_CALL_ACTION", + @"button title to confirm calling a recipient whose safety " + @"number recently changed") + completion:^(BOOL didConfirmedIdentity) { + if (didConfirmedIdentity) { + [weakSelf callAction:sender]; + } + }]; + return; + } + + [self.outboundCallInitiator initiateCallWithRecipientId:self.thread.contactIdentifier]; } @@ -1737,6 +1752,9 @@ typedef enum : NSUInteger { if (unconfirmedIdentityThatShouldBlockSending != nil) { __weak MessagesViewController *weakSelf = self; [self showConfirmIdentityUIForRecipientIdentity:unconfirmedIdentityThatShouldBlockSending + confirmationText:NSLocalizedString(@"SAFETY_NUMBER_CHANGED_CONFIRM_SEND_ACTION", + @"button title to confirm sending to a recipient whose " + @"safety number recently changed") completion:^(BOOL didConfirmedIdentity) { if (didConfirmedIdentity) { [weakSelf didPressSendButton:button diff --git a/Signal/translations/en.lproj/Localizable.strings b/Signal/translations/en.lproj/Localizable.strings index 7ef055594..0ac295940 100644 --- a/Signal/translations/en.lproj/Localizable.strings +++ b/Signal/translations/en.lproj/Localizable.strings @@ -1051,6 +1051,9 @@ /* Generic text for button that retries whatever the last action was. */ "RETRY_BUTTON_TEXT" = "Retry"; +/* button title to confirm calling a recipient whose safety number recently changed */ +"SAFETY_NUMBER_CHANGED_CONFIRM_CALL_ACTION" = "Confirm and Call"; + /* button title to confirm sending to a recipient whose safety number recently changed */ "SAFETY_NUMBER_CHANGED_CONFIRM_SEND_ACTION" = "Confirm and Send"; @@ -1363,7 +1366,8 @@ /* Label indicating the phone number currently being verified. */ "VERIFICATION_PHONE_NUMBER_FORMAT" = "Enter the verification code we sent to %@."; -/* table cell label in conversation settings */ +/* Action sheet item + table cell label in conversation settings */ "VERIFY_PRIVACY" = "Show Safety Number"; /* Indicates how to cancel a voice message. */