|
|
@ -1352,8 +1352,7 @@ 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];
|
|
|
|
}]];
|
|
|
|
}]];
|
|
|
@ -1362,8 +1361,7 @@ const NSUInteger kOWSProfileManager_MaxAvatarDiameter = 640;
|
|
|
|
[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
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -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];
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}];
|
|
|
|
}];
|
|
|
|
}
|
|
|
|
}
|
|
|
|