Show "share profile with group" banner.

// FREEBIE
pull/1/head
Matthew Chen 8 years ago
parent 673c44e131
commit ae1908c40c

@ -354,9 +354,7 @@
handler:^(UIAlertAction *action) { handler:^(UIAlertAction *action) {
[self proceedToUnregistration]; [self proceedToUnregistration];
}]]; }]];
[alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"TXT_CANCEL_TITLE", @"") [alertController addAction:[OWSAlerts cancelAction]];
style:UIAlertActionStyleCancel
handler:nil]];
[self presentViewController:alertController animated:YES completion:nil]; [self presentViewController:alertController animated:YES completion:nil];
} }

@ -4,6 +4,7 @@
#import "AvatarViewHelper.h" #import "AvatarViewHelper.h"
#import "OWSContactsManager.h" #import "OWSContactsManager.h"
#import "Signal-Swift.h"
#import "UIUtil.h" #import "UIUtil.h"
#import <MobileCoreServices/UTCoreTypes.h> #import <MobileCoreServices/UTCoreTypes.h>
#import <SignalServiceKit/PhoneNumber.h> #import <SignalServiceKit/PhoneNumber.h>
@ -32,10 +33,7 @@ NS_ASSUME_NONNULL_BEGIN
[UIAlertController alertControllerWithTitle:self.delegate.avatarActionSheetTitle [UIAlertController alertControllerWithTitle:self.delegate.avatarActionSheetTitle
message:nil message:nil
preferredStyle:UIAlertControllerStyleActionSheet]; preferredStyle:UIAlertControllerStyleActionSheet];
UIAlertAction *dismissAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"TXT_CANCEL_TITLE", @"") [actionSheetController addAction:[OWSAlerts cancelAction]];
style:UIAlertActionStyleCancel
handler:nil];
[actionSheetController addAction:dismissAction];
UIAlertAction *takePictureAction = [UIAlertAction UIAlertAction *takePictureAction = [UIAlertAction
actionWithTitle:NSLocalizedString(@"MEDIA_FROM_CAMERA_BUTTON", @"media picker option to take photo or video") actionWithTitle:NSLocalizedString(@"MEDIA_FROM_CAMERA_BUTTON", @"media picker option to take photo or video")

@ -784,6 +784,15 @@ typedef enum : NSUInteger {
[self createBannerWithTitle:blockStateMessage [self createBannerWithTitle:blockStateMessage
bannerColor:[UIColor ows_destructiveRedColor] bannerColor:[UIColor ows_destructiveRedColor]
tapSelector:@selector(blockBannerViewWasTapped:)]; tapSelector:@selector(blockBannerViewWasTapped:)];
return;
}
if ([ThreadUtil shouldShowGroupProfileBannerInThread:self.thread blockingManager:self.blockingManager]) {
[self createBannerWithTitle:
NSLocalizedString(@"MESSAGES_VIEW_GROUP_PROFILE_WHITELIST_BANNER",
@"Text for banner in group conversation view that offers to share your profile with this group.")
bannerColor:[UIColor ows_reminderYellowColor]
tapSelector:@selector(groupProfileWhitelistBannerWasTapped:)];
} }
} }
@ -866,6 +875,30 @@ typedef enum : NSUInteger {
} }
} }
- (void)groupProfileWhitelistBannerWasTapped:(UIGestureRecognizer *)sender
{
if (sender.state != UIGestureRecognizerStateRecognized) {
return;
}
UIAlertController *alertController =
[UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
UIAlertAction *leaveAction = [UIAlertAction
actionWithTitle:NSLocalizedString(@"CONVERSATION_SETTINGS_VIEW_SHARE_PROFILE",
@"Button to confirm that user wants to share their profile with a user or group.")
style:UIAlertActionStyleDestructive
handler:^(UIAlertAction *_Nonnull action) {
[OWSProfileManager.sharedManager addThreadToProfileWhitelist:self.thread];
[self ensureBannerState];
}];
[alertController addAction:leaveAction];
[alertController addAction:[OWSAlerts cancelAction]];
[self presentViewController:alertController animated:YES completion:nil];
}
- (void)noLongerVerifiedBannerViewWasTapped:(UIGestureRecognizer *)sender - (void)noLongerVerifiedBannerViewWasTapped:(UIGestureRecognizer *)sender
{ {
if (sender.state == UIGestureRecognizerStateRecognized) { if (sender.state == UIGestureRecognizerStateRecognized) {
@ -2388,10 +2421,7 @@ typedef enum : NSUInteger {
message:nil message:nil
preferredStyle:UIAlertControllerStyleActionSheet]; preferredStyle:UIAlertControllerStyleActionSheet];
UIAlertAction *dismissAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"TXT_CANCEL_TITLE", @"") [actionSheetController addAction:[OWSAlerts cancelAction]];
style:UIAlertActionStyleCancel
handler:nil];
[actionSheetController addAction:dismissAction];
UIAlertAction *deleteMessageAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"TXT_DELETE_TITLE", @"") UIAlertAction *deleteMessageAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"TXT_DELETE_TITLE", @"")
style:UIAlertActionStyleDestructive style:UIAlertActionStyleDestructive
@ -2430,10 +2460,7 @@ typedef enum : NSUInteger {
message:nil message:nil
preferredStyle:UIAlertControllerStyleActionSheet]; preferredStyle:UIAlertControllerStyleActionSheet];
UIAlertAction *dismissAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"TXT_CANCEL_TITLE", @"") [actionSheetController addAction:[OWSAlerts cancelAction]];
style:UIAlertActionStyleCancel
handler:nil];
[actionSheetController addAction:dismissAction];
UIAlertAction *deleteMessageAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"TXT_DELETE_TITLE", @"") UIAlertAction *deleteMessageAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"TXT_DELETE_TITLE", @"")
style:UIAlertActionStyleDestructive style:UIAlertActionStyleDestructive
@ -2566,10 +2593,7 @@ typedef enum : NSUInteger {
message:alertMessage message:alertMessage
preferredStyle:UIAlertControllerStyleAlert]; preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *dismissAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"TXT_CANCEL_TITLE", @"") [alertController addAction:[OWSAlerts cancelAction]];
style:UIAlertActionStyleCancel
handler:nil];
[alertController addAction:dismissAction];
UIAlertAction *resetSessionAction = [UIAlertAction UIAlertAction *resetSessionAction = [UIAlertAction
actionWithTitle:NSLocalizedString(@"FINGERPRINT_SHRED_KEYMATERIAL_BUTTON", @"") actionWithTitle:NSLocalizedString(@"FINGERPRINT_SHRED_KEYMATERIAL_BUTTON", @"")
@ -2601,10 +2625,7 @@ typedef enum : NSUInteger {
message:nil message:nil
preferredStyle:UIAlertControllerStyleActionSheet]; preferredStyle:UIAlertControllerStyleActionSheet];
UIAlertAction *dismissAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"TXT_CANCEL_TITLE", @"") [actionSheetController addAction:[OWSAlerts cancelAction]];
style:UIAlertActionStyleCancel
handler:nil];
[actionSheetController addAction:dismissAction];
UIAlertAction *showSafteyNumberAction = UIAlertAction *showSafteyNumberAction =
[UIAlertAction actionWithTitle:NSLocalizedString(@"SHOW_SAFETY_NUMBER_ACTION", @"Action sheet item") [UIAlertAction actionWithTitle:NSLocalizedString(@"SHOW_SAFETY_NUMBER_ACTION", @"Action sheet item")
@ -2657,10 +2678,7 @@ typedef enum : NSUInteger {
[weakSelf callAction:nil]; [weakSelf callAction:nil];
}]; }];
[alertController addAction:callAction]; [alertController addAction:callAction];
UIAlertAction *dismissAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"TXT_CANCEL_TITLE", nil) [alertController addAction:[OWSAlerts cancelAction]];
style:UIAlertActionStyleCancel
handler:nil];
[alertController addAction:dismissAction];
[[UIApplication sharedApplication].frontmostViewController presentViewController:alertController [[UIApplication sharedApplication].frontmostViewController presentViewController:alertController
animated:YES animated:YES
@ -2687,10 +2705,7 @@ typedef enum : NSUInteger {
UIAlertController *actionSheetController = UIAlertController *actionSheetController =
[UIAlertController alertControllerWithTitle:title message:nil preferredStyle:UIAlertControllerStyleActionSheet]; [UIAlertController alertControllerWithTitle:title message:nil preferredStyle:UIAlertControllerStyleActionSheet];
UIAlertAction *dismissAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"TXT_CANCEL_TITLE", @"") [actionSheetController addAction:[OWSAlerts cancelAction]];
style:UIAlertActionStyleCancel
handler:nil];
[actionSheetController addAction:dismissAction];
UIAlertAction *blockAction = UIAlertAction *blockAction =
[UIAlertAction actionWithTitle:NSLocalizedString(@"BLOCK_OFFER_ACTIONSHEET_BLOCK_ACTION", [UIAlertAction actionWithTitle:NSLocalizedString(@"BLOCK_OFFER_ACTIONSHEET_BLOCK_ACTION",
@ -2762,12 +2777,7 @@ typedef enum : NSUInteger {
}]; }];
[alertController addAction:leaveAction]; [alertController addAction:leaveAction];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"TXT_CANCEL_TITLE", nil) [alertController addAction:[OWSAlerts cancelAction]];
style:UIAlertActionStyleCancel
handler:^(UIAlertAction *_Nonnull action){
// Do nothing.
}];
[alertController addAction:cancelAction];
[self presentViewController:alertController animated:YES completion:nil]; [self presentViewController:alertController animated:YES completion:nil];
} }
@ -3757,10 +3767,7 @@ typedef enum : NSUInteger {
UIAlertController *actionSheetController = UIAlertController *actionSheetController =
[UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet]; [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"TXT_CANCEL_TITLE", @"") [actionSheetController addAction:[OWSAlerts cancelAction]];
style:UIAlertActionStyleCancel
handler:nil];
[actionSheetController addAction:cancelAction];
UIAlertAction *takeMediaAction = [UIAlertAction UIAlertAction *takeMediaAction = [UIAlertAction
actionWithTitle:NSLocalizedString(@"MEDIA_FROM_CAMERA_BUTTON", @"media picker option to take photo or video") actionWithTitle:NSLocalizedString(@"MEDIA_FROM_CAMERA_BUTTON", @"media picker option to take photo or video")

@ -249,12 +249,7 @@ NS_ASSUME_NONNULL_BEGIN
}]]; }]];
} }
UIAlertAction *dismissAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"TXT_CANCEL_TITLE", nil) [alertController addAction:[OWSAlerts cancelAction]];
style:UIAlertActionStyleCancel
handler:^(UIAlertAction *action) {
cancelBlock();
}];
[alertController addAction:dismissAction];
[viewController presentViewController:alertController animated:YES completion:nil]; [viewController presentViewController:alertController animated:YES completion:nil];

@ -516,12 +516,6 @@ NS_ASSUME_NONNULL_BEGIN
message:confirmMessage message:confirmMessage
preferredStyle:UIAlertControllerStyleAlert]; preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"TXT_CANCEL_TITLE", @"")
style:UIAlertActionStyleCancel
handler:^(UIAlertAction *action) {
DDLogDebug(@"Cancel action");
}];
UIAlertAction *okAction = [UIAlertAction UIAlertAction *okAction = [UIAlertAction
actionWithTitle:NSLocalizedString(@"OK", @"") actionWithTitle:NSLocalizedString(@"OK", @"")
style:UIAlertActionStyleDefault style:UIAlertActionStyleDefault
@ -545,7 +539,7 @@ NS_ASSUME_NONNULL_BEGIN
} }
}]; }];
[alertController addAction:cancelAction]; [alertController addAction:[OWSAlerts cancelAction]];
[alertController addAction:okAction]; [alertController addAction:okAction];
self.searchBar.text = @""; self.searchBar.text = @"";

@ -572,9 +572,7 @@ const NSUInteger kNewGroupViewControllerAvatarWidth = 68;
handler:^(UIAlertAction *action) { handler:^(UIAlertAction *action) {
[self.navigationController popViewControllerAnimated:YES]; [self.navigationController popViewControllerAnimated:YES];
}]]; }]];
[controller addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"TXT_CANCEL_TITLE", nil) [controller addAction:[OWSAlerts cancelAction]];
style:UIAlertActionStyleCancel
handler:nil]];
[self presentViewController:controller animated:YES completion:nil]; [self presentViewController:controller animated:YES completion:nil];
} }

@ -774,6 +774,8 @@ NS_ASSUME_NONNULL_BEGIN
- (void)showShareProfileAlert - (void)showShareProfileAlert
{ {
[self.tableView deselectRowAtIndexPath:[self.tableView indexPathForSelectedRow] animated:YES];
UIAlertController *alertController = UIAlertController *alertController =
[UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet]; [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
@ -785,14 +787,7 @@ NS_ASSUME_NONNULL_BEGIN
[self shareProfile]; [self shareProfile];
}]; }];
[alertController addAction:leaveAction]; [alertController addAction:leaveAction];
[alertController addAction:[OWSAlerts cancelAction]];
UIAlertAction *cancelAction = [UIAlertAction
actionWithTitle:NSLocalizedString(@"TXT_CANCEL_TITLE", nil)
style:UIAlertActionStyleCancel
handler:^(UIAlertAction *_Nonnull action) {
[self.tableView deselectRowAtIndexPath:[self.tableView indexPathForSelectedRow] animated:YES];
}];
[alertController addAction:cancelAction];
[self presentViewController:alertController animated:YES completion:nil]; [self presentViewController:alertController animated:YES completion:nil];
} }
@ -872,6 +867,8 @@ NS_ASSUME_NONNULL_BEGIN
- (void)didTapLeaveGroup - (void)didTapLeaveGroup
{ {
[self.tableView deselectRowAtIndexPath:[self.tableView indexPathForSelectedRow] animated:YES];
UIAlertController *alertController = UIAlertController *alertController =
[UIAlertController alertControllerWithTitle:NSLocalizedString(@"CONFIRM_LEAVE_GROUP_TITLE", @"Alert title") [UIAlertController alertControllerWithTitle:NSLocalizedString(@"CONFIRM_LEAVE_GROUP_TITLE", @"Alert title")
message:NSLocalizedString(@"CONFIRM_LEAVE_GROUP_DESCRIPTION", @"Alert body") message:NSLocalizedString(@"CONFIRM_LEAVE_GROUP_DESCRIPTION", @"Alert body")
@ -884,14 +881,7 @@ NS_ASSUME_NONNULL_BEGIN
[self leaveGroup]; [self leaveGroup];
}]; }];
[alertController addAction:leaveAction]; [alertController addAction:leaveAction];
[alertController addAction:[OWSAlerts cancelAction]];
UIAlertAction *cancelAction = [UIAlertAction
actionWithTitle:NSLocalizedString(@"TXT_CANCEL_TITLE", nil)
style:UIAlertActionStyleCancel
handler:^(UIAlertAction *_Nonnull action) {
[self.tableView deselectRowAtIndexPath:[self.tableView indexPathForSelectedRow] animated:YES];
}];
[alertController addAction:cancelAction];
[self presentViewController:alertController animated:YES completion:nil]; [self presentViewController:alertController animated:YES completion:nil];
} }
@ -1114,10 +1104,7 @@ NS_ASSUME_NONNULL_BEGIN
}]]; }]];
} }
UIAlertAction *dismissAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"TXT_CANCEL_TITLE", @"") [actionSheetController addAction:[OWSAlerts cancelAction]];
style:UIAlertActionStyleCancel
handler:nil];
[actionSheetController addAction:dismissAction];
[self presentViewController:actionSheetController animated:YES completion:nil]; [self presentViewController:actionSheetController animated:YES completion:nil];
} }

@ -338,10 +338,7 @@ int const OWSLinkedDevicesTableViewControllerSectionAddDevice = 1;
message:confirmationMessage message:confirmationMessage
preferredStyle:UIAlertControllerStyleAlert]; preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"TXT_CANCEL_TITLE", nil) [alertController addAction:[OWSAlerts cancelAction]];
style:UIAlertActionStyleCancel
handler:nil];
[alertController addAction:cancelAction];
UIAlertAction *unlinkAction = UIAlertAction *unlinkAction =
[UIAlertAction actionWithTitle:NSLocalizedString(@"UNLINK_ACTION", "button title for unlinking a device") [UIAlertAction actionWithTitle:NSLocalizedString(@"UNLINK_ACTION", "button title for unlinking a device")
@ -377,12 +374,7 @@ int const OWSLinkedDevicesTableViewControllerSectionAddDevice = 1;
[self unlinkDevice:device success:successCallback]; [self unlinkDevice:device success:successCallback];
}]; }];
[alertController addAction:retryAction]; [alertController addAction:retryAction];
[alertController addAction:[OWSAlerts cancelAction]];
UIAlertAction *cancelRetryAction =
[UIAlertAction actionWithTitle:NSLocalizedString(@"TXT_CANCEL_TITLE", nil)
style:UIAlertActionStyleCancel
handler:nil];
[alertController addAction:cancelRetryAction];
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
[self presentViewController:alertController animated:YES completion:nil]; [self presentViewController:alertController animated:YES completion:nil];

@ -116,10 +116,7 @@ NS_ASSUME_NONNULL_BEGIN
@"Alert message before user confirms clearing history") @"Alert message before user confirms clearing history")
preferredStyle:UIAlertControllerStyleAlert]; preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *dismissAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"TXT_CANCEL_TITLE", @"") [alertController addAction:[OWSAlerts cancelAction]];
style:UIAlertActionStyleCancel
handler:nil];
[alertController addAction:dismissAction];
UIAlertAction *deleteAction = UIAlertAction *deleteAction =
[UIAlertAction actionWithTitle:NSLocalizedString(@"SETTINGS_DELETE_HISTORYLOG_CONFIRMATION_BUTTON", @"") [UIAlertAction actionWithTitle:NSLocalizedString(@"SETTINGS_DELETE_HISTORYLOG_CONFIRMATION_BUTTON", @"")

@ -294,9 +294,7 @@ NSString *const kProfileView_LastPresentedDate = @"kProfileView_LastPresentedDat
handler:^(UIAlertAction *action) { handler:^(UIAlertAction *action) {
[self profileCompletedOrSkipped]; [self profileCompletedOrSkipped];
}]]; }]];
[controller addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"TXT_CANCEL_TITLE", nil) [controller addAction:[OWSAlerts cancelAction]];
style:UIAlertActionStyleCancel
handler:nil]];
[self presentViewController:controller animated:YES completion:nil]; [self presentViewController:controller animated:YES completion:nil];
} }

@ -74,8 +74,7 @@ class SafetyNumberConfirmationAlert: NSObject {
} }
actionSheetController.addAction(showSafetyNumberAction) actionSheetController.addAction(showSafetyNumberAction)
let dismissAction = UIAlertAction(title: NSLocalizedString("TXT_CANCEL_TITLE", comment: "generic cancel text"), style: .cancel) actionSheetController.addAction(OWSAlerts.cancelAction())
actionSheetController.addAction(dismissAction)
UIApplication.shared.frontmostViewController?.present(actionSheetController, animated: true) UIApplication.shared.frontmostViewController?.present(actionSheetController, animated: true)
return true return true

@ -227,11 +227,7 @@ NS_ASSUME_NONNULL_BEGIN
[weakSelf resetAllNoLongerVerified]; [weakSelf resetAllNoLongerVerified];
}]; }];
[actionSheetController addAction:verifyAction]; [actionSheetController addAction:verifyAction];
[actionSheetController addAction:[OWSAlerts cancelAction]];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"TXT_CANCEL_TITLE", @"")
style:UIAlertActionStyleCancel
handler:nil];
[actionSheetController addAction:cancelAction];
[self presentViewController:actionSheetController animated:YES completion:nil]; [self presentViewController:actionSheetController animated:YES completion:nil];
} }
@ -390,10 +386,7 @@ NS_ASSUME_NONNULL_BEGIN
}]]; }]];
} }
UIAlertAction *dismissAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"TXT_CANCEL_TITLE", @"") [actionSheetController addAction:[OWSAlerts cancelAction]];
style:UIAlertActionStyleCancel
handler:nil];
[actionSheetController addAction:dismissAction];
[self presentViewController:actionSheetController animated:YES completion:nil]; [self presentViewController:actionSheetController animated:YES completion:nil];
} }

@ -93,6 +93,8 @@ NS_ASSUME_NONNULL_BEGIN
firstUnseenInteractionTimestamp:(nullable NSNumber *)firstUnseenInteractionTimestamp firstUnseenInteractionTimestamp:(nullable NSNumber *)firstUnseenInteractionTimestamp
maxRangeSize:(int)maxRangeSize; maxRangeSize:(int)maxRangeSize;
+ (BOOL)shouldShowGroupProfileBannerInThread:(TSThread *)thread blockingManager:(OWSBlockingManager *)blockingManager;
// This method should be called right _before_ we send a message to a thread, // This method should be called right _before_ we send a message to a thread,
// since we want to auto-add contact threads to the profile whitelist if the // since we want to auto-add contact threads to the profile whitelist if the
// conversation was initiated by the local user. // conversation was initiated by the local user.

@ -422,7 +422,7 @@ NS_ASSUME_NONNULL_BEGIN
if (!hasUnwhitelistedMember) { if (!hasUnwhitelistedMember) {
// Don't show offer in group thread if all members are already individually // Don't show offer in group thread if all members are already individually
// whitelisted. // whitelisted.
hasUnwhitelistedMember = YES; shouldHaveAddToProfileWhitelistOffer = NO;
} }
} }
@ -531,6 +531,35 @@ NS_ASSUME_NONNULL_BEGIN
return result; return result;
} }
+ (BOOL)shouldShowGroupProfileBannerInThread:(TSThread *)thread blockingManager:(OWSBlockingManager *)blockingManager
{
OWSAssert(thread);
OWSAssert(blockingManager);
if (!thread.isGroupThread) {
return NO;
}
if ([OWSProfileManager.sharedManager isThreadInProfileWhitelist:thread]) {
return NO;
}
if (![OWSProfileManager.sharedManager hasLocalProfile]) {
return NO;
}
BOOL hasUnwhitelistedMember = NO;
NSArray<NSString *> *blockedPhoneNumbers = [blockingManager blockedPhoneNumbers];
for (NSString *recipientId in thread.recipientIdentifiers) {
if (![blockedPhoneNumbers containsObject:recipientId]
&& ![OWSProfileManager.sharedManager isUserInProfileWhitelist:recipientId]) {
hasUnwhitelistedMember = YES;
break;
}
}
if (!hasUnwhitelistedMember) {
return NO;
}
return YES;
}
+ (BOOL)addThreadToProfileWhitelistIfEmptyContactThread:(TSThread *)thread + (BOOL)addThreadToProfileWhitelistIfEmptyContactThread:(TSThread *)thread
{ {
OWSAssert(thread); OWSAssert(thread);

@ -39,4 +39,13 @@ import Foundation
alert.addAction(UIAlertAction(title: actionTitle, style: .default, handler: nil)) alert.addAction(UIAlertAction(title: actionTitle, style: .default, handler: nil))
UIApplication.shared.frontmostViewController?.present(alert, animated: true, completion: nil) UIApplication.shared.frontmostViewController?.present(alert, animated: true, completion: nil)
} }
public class func cancelAction() -> UIAlertAction {
let action = UIAlertAction(title: NSLocalizedString("TXT_CANCEL_TITLE", comment:"Label for the cancel button in an alert or action sheet."), style: .cancel) { _ in
Logger.debug("Cancel item")
// Do nothing.
}
return action
}
} }

@ -814,6 +814,9 @@
/* Indicates that some members of this group has been blocked. Embeds {{the number of blocked users in this group}}. */ /* Indicates that some members of this group has been blocked. Embeds {{the number of blocked users in this group}}. */
"MESSAGES_VIEW_GROUP_N_MEMBERS_BLOCKED_FORMAT" = "You Blocked %@ Members of this Group"; "MESSAGES_VIEW_GROUP_N_MEMBERS_BLOCKED_FORMAT" = "You Blocked %@ Members of this Group";
/* Text for banner in group conversation view that offers to share your profile with this group. */
"MESSAGES_VIEW_GROUP_PROFILE_WHITELIST_BANNER" = "Share Your Profile With This Group?";
/* Indicates that more than one member of this group conversation is no longer verified. */ /* Indicates that more than one member of this group conversation is no longer verified. */
"MESSAGES_VIEW_N_MEMBERS_NO_LONGER_VERIFIED" = "More than one member of this group is no longer marked as verified. Tap for options."; "MESSAGES_VIEW_N_MEMBERS_NO_LONGER_VERIFIED" = "More than one member of this group is no longer marked as verified. Tap for options.";
@ -1450,7 +1453,7 @@
/* {{number of weeks}}, embedded in strings, e.g. 'Alice updated disappearing messages expiration to {{5 weeks}}'. See other *_TIME_AMOUNT strings */ /* {{number of weeks}}, embedded in strings, e.g. 'Alice updated disappearing messages expiration to {{5 weeks}}'. See other *_TIME_AMOUNT strings */
"TIME_AMOUNT_WEEKS" = "%@ weeks"; "TIME_AMOUNT_WEEKS" = "%@ weeks";
/* generic cancel text */ /* Label for the cancel button in an alert or action sheet. */
"TXT_CANCEL_TITLE" = "Cancel"; "TXT_CANCEL_TITLE" = "Cancel";
/* No comment provided by engineer. */ /* No comment provided by engineer. */

Loading…
Cancel
Save