diff --git a/Signal/src/ViewControllers/InviteFlow.swift b/Signal/src/ViewControllers/InviteFlow.swift index 7f4b9a852..f15fbdd8b 100644 --- a/Signal/src/ViewControllers/InviteFlow.swift +++ b/Signal/src/ViewControllers/InviteFlow.swift @@ -169,7 +169,21 @@ class InviteFlow: NSObject, MFMessageComposeViewControllerDelegate, MFMailCompos public func dismissAndSendSMSTo(phoneNumbers: [String]) { self.presentingViewController.dismiss(animated: true) { - self.sendSMSTo(phoneNumbers: phoneNumbers) + if phoneNumbers.count > 0 { + let warning = UIAlertController(title: nil, + message: NSLocalizedString("INVITE_WARNING_MULTIPLE_INVITES_BY_TEXT", + comment: "Alert warning that sending an invite to multiple users will create a group message whose recipients will be able to see each other."), + preferredStyle: .alert) + warning.addAction(UIAlertAction(title: NSLocalizedString("BUTTON_CONTINUE", + comment: "Label for 'continue' button."), + style: .default, handler: { _ in + self.sendSMSTo(phoneNumbers: phoneNumbers) + })) + warning.addAction(OWSAlerts.cancelAction) + self.presentingViewController.present(warning, animated: true, completion: nil) + } else { + self.sendSMSTo(phoneNumbers: phoneNumbers) + } } } diff --git a/Signal/translations/en.lproj/Localizable.strings b/Signal/translations/en.lproj/Localizable.strings index f1076c2e9..847b85e13 100644 --- a/Signal/translations/en.lproj/Localizable.strings +++ b/Signal/translations/en.lproj/Localizable.strings @@ -274,6 +274,9 @@ /* Title format for action sheet that offers to block an unknown user.Embeds {{the unknown user's name or phone number}}. */ "BLOCK_OFFER_ACTIONSHEET_TITLE_FORMAT" = "Block %@?"; +/* Label for 'continue' button. */ +"BUTTON_CONTINUE" = "Continue"; + /* Label for generic done button. */ "BUTTON_DONE" = "Done"; @@ -794,6 +797,9 @@ /* Call setup status label */ "END_CALL_UNCATEGORIZED_FAILURE" = "Call Failed."; +/* Error indicating that the phone's contacts could not be retrieved. */ +"ERROR_COULD_NOT_FETCH_CONTACTS" = "Could not access contacts."; + /* Generic notice when message failed to send. */ "ERROR_DESCRIPTION_CLIENT_SENDING_FAILURE" = "Failed to send message."; @@ -1040,6 +1046,9 @@ /* Navbar title */ "INVITE_FRIENDS_PICKER_TITLE" = "Invite Friends"; +/* Alert warning that sending an invite to multiple users will create a group message whose recipients will be able to see each other. */ +"INVITE_WARNING_MULTIPLE_INVITES_BY_TEXT" = "Inviting multiple users at the same time will send a group message whose recipients will be able to see each other."; + /* Slider label embeds {{TIME_AMOUNT}}, e.g. '2 hours'. See *_TIME_AMOUNT strings for examples. */ "KEEP_MESSAGES_DURATION" = "Messages disappear after %@.";