remove retry logic per code review

the system naturally recovers anyway, upon sending messages, no need to
hit the user with another alert.

// FREEBIE
pull/1/head
Michael Kirk 8 years ago
parent d71b7684a6
commit 42934e5fd4

@ -1352,20 +1352,18 @@ const NSUInteger kOWSProfileManager_MaxAvatarDiameter = 640;
[alertController addAction:[UIAlertAction actionWithTitle:shareTitle [alertController addAction:[UIAlertAction actionWithTitle:shareTitle
style:UIAlertActionStyleDefault style:UIAlertActionStyleDefault
handler:^(UIAlertAction *_Nonnull action) { handler:^(UIAlertAction *_Nonnull action) {
[self addThreadToProfileWhitelist:thread [self userAddedThreadToProfileWhitelist:thread
fromViewController:fromViewController messageSender:messageSender
messageSender:messageSender success:successHandler];
success:successHandler];
}]]; }]];
[alertController addAction:[OWSAlerts cancelAction]]; [alertController addAction:[OWSAlerts cancelAction]];
[fromViewController presentViewController:alertController animated:YES completion:nil]; [fromViewController presentViewController:alertController animated:YES completion:nil];
} }
- (void)addThreadToProfileWhitelist:(TSThread *)thread - (void)userAddedThreadToProfileWhitelist:(TSThread *)thread
fromViewController:(UIViewController *)fromViewController messageSender:(OWSMessageSender *)messageSender
messageSender:(OWSMessageSender *)messageSender success:(void (^)())successHandler
success:(void (^)())successHandler
{ {
AssertIsOnMainThread(); AssertIsOnMainThread();
@ -1392,23 +1390,6 @@ const NSUInteger kOWSProfileManager_MaxAvatarDiameter = 640;
failure:^(NSError *_Nonnull error) { failure:^(NSError *_Nonnull error) {
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
DDLogError(@"%@ Failed to send profile key message to thread: %@", self.tag, thread); DDLogError(@"%@ Failed to send profile key message to thread: %@", self.tag, thread);
UIAlertController *retryAlertController = [UIAlertController
alertControllerWithTitle:NSLocalizedString(@"SHARE_PROFILE_FAILED_TITLE", @"alert title")
message:error.localizedDescription
preferredStyle:UIAlertControllerStyleAlert];
[retryAlertController
addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"RETRY_BUTTON_TEXT", nil)
style:UIAlertActionStyleDefault
handler:^(UIAlertAction *_Nonnull retryAction) {
[self addThreadToProfileWhitelist:thread
fromViewController:fromViewController
messageSender:messageSender
success:successHandler];
}]];
[retryAlertController addAction:[OWSAlerts cancelAction]];
[fromViewController presentViewController:retryAlertController animated:YES completion:nil];
}); });
}]; }];
} }

@ -1417,9 +1417,6 @@
/* action sheet item */ /* action sheet item */
"SHARE_ACTION_TWEET" = "Twitter"; "SHARE_ACTION_TWEET" = "Twitter";
/* alert title */
"SHARE_PROFILE_FAILED_TITLE" = "Failed to Share Your Profile";
/* Action sheet item */ /* Action sheet item */
"SHOW_SAFETY_NUMBER_ACTION" = "Show New Safety Number"; "SHOW_SAFETY_NUMBER_ACTION" = "Show New Safety Number";

Loading…
Cancel
Save