Merge branch 'mkirk/block-file-sharing'

pull/1/head
Michael Kirk 8 years ago
commit 640b210f1e

@ -29,3 +29,8 @@ import Foundation
static let missedCallWithIdentityChangeNotificationBodyWithoutCallerName = NSLocalizedString("MISSED_CALL_WITH_CHANGED_IDENTITY_BODY_WITHOUT_CALLER_NAME", comment: "notification title")
static let missedCallWithIdentityChangeNotificationBodyWithCallerName = NSLocalizedString("MISSED_CALL_WITH_CHANGED_IDENTITY_BODY_WITH_CALLER_NAME", comment: "notification title. Embeds {{caller's name or phone number}}")
}
@objc class SafetyNumberStrings: NSObject {
static let confirmSendButton = NSLocalizedString("SAFETY_NUMBER_CHANGED_CONFIRM_SEND_ACTION",
comment: "button title to confirm sending to a recipient whose safety number recently changed")
}

@ -1167,8 +1167,7 @@ typedef enum : NSUInteger {
* NO if there were no unconfirmed identities
*/
- (BOOL)showSafetyNumberConfirmationIfNecessaryWithConfirmationText:(NSString *)confirmationText
completion:
(void (^)(BOOL didConfirmedIdentity))completionHandler
completion:(void (^)(BOOL didConfirmIdentity))completionHandler
{
return [SafetyNumberConfirmationAlert presentAlertIfNecessaryWithRecipientIds:self.thread.recipientIdentifiers
confirmationText:confirmationText
@ -1283,10 +1282,7 @@ typedef enum : NSUInteger {
}
BOOL didShowSNAlert =
[self showSafetyNumberConfirmationIfNecessaryWithConfirmationText:
NSLocalizedString(@"SAFETY_NUMBER_CHANGED_CONFIRM_SEND_ACTION",
@"button title to confirm sending to a recipient whose "
@"safety number recently changed")
[self showSafetyNumberConfirmationIfNecessaryWithConfirmationText:[SafetyNumberStrings confirmSendButton]
completion:^(BOOL didConfirmIdentity) {
if (didConfirmIdentity) {
[weakSelf didPressSendButton:button
@ -3704,10 +3700,7 @@ typedef enum : NSUInteger {
}
BOOL didShowSNAlert = [self
showSafetyNumberConfirmationIfNecessaryWithConfirmationText:
NSLocalizedString(@"SAFETY_NUMBER_CHANGED_CONFIRM_SEND_ACTION",
@"button title to confirm sending to a recipient whose "
@"safety number recently changed")
showSafetyNumberConfirmationIfNecessaryWithConfirmationText:[SafetyNumberStrings confirmSendButton]
completion:^(BOOL didConfirmIdentity) {
if (didConfirmIdentity) {
[weakSelf

@ -15,6 +15,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface SendExternalFileViewController () <SelectThreadViewControllerDelegate>
@property (nonatomic, readonly) OWSContactsManager *contactsManager;
@property (nonatomic, readonly) OWSMessageSender *messageSender;
@end
@ -35,6 +36,7 @@ NS_ASSUME_NONNULL_BEGIN
{
[super loadView];
_contactsManager = [Environment getCurrent].contactsManager;
_messageSender = [Environment getCurrent].messageSender;
self.title = NSLocalizedString(@"SEND_EXTERNAL_FILE_VIEW_TITLE", @"Title for the 'send external file' view.");
@ -47,6 +49,21 @@ NS_ASSUME_NONNULL_BEGIN
OWSAssert(self.attachment);
OWSAssert(thread);
__weak typeof(self) weakSelf = self;
BOOL didShowSNAlert =
[SafetyNumberConfirmationAlert presentAlertIfNecessaryWithRecipientIds:thread.recipientIdentifiers
confirmationText:[SafetyNumberStrings confirmSendButton]
contactsManager:self.contactsManager
completion:^(BOOL didConfirm) {
if (didConfirm) {
[weakSelf threadWasSelected:thread];
}
}];
if (didShowSNAlert) {
return;
}
[ThreadUtil sendMessageWithAttachment:self.attachment inThread:thread messageSender:self.messageSender];
[Environment messageThreadId:thread.uniqueId];

Loading…
Cancel
Save