add toggle for unrestricted access

pull/1/head
Michael Kirk 7 years ago
parent 9323e411fc
commit c680908646

@ -12,6 +12,7 @@
#import <SignalMessaging/ThreadUtil.h>
#import <SignalServiceKit/OWS2FAManager.h>
#import <SignalServiceKit/OWSReadReceiptManager.h>
#import <SignalServiceKit/SignalServiceKit-Swift.h>
NS_ASSUME_NONNULL_BEGIN
@ -48,6 +49,13 @@ NS_ASSUME_NONNULL_BEGIN
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
#pragma mark - Dependencies
- (id<OWSUDManager>)udManager
{
return SSKEnvironment.shared.udManager;
}
#pragma mark - Table Contents
- (void)updateTableContents
@ -193,6 +201,22 @@ NS_ASSUME_NONNULL_BEGIN
}]];
[contents addSection:historyLogsSection];
OWSTableSection *unidentifiedDeliverySection = [OWSTableSection new];
unidentifiedDeliverySection.headerTitle
= NSLocalizedString(@"SETTINGS_UNIDENTIFIED_DELIVERY_SECTION_TITLE", @"table section label");
unidentifiedDeliverySection.footerTitle
= NSLocalizedString(@"SETTINGS_UNIDENTIFIED_DELIVERY_SECTION_FOOTER", @"table section footer");
OWSTableItem *unrestrictedAccessItem = [OWSTableItem
switchItemWithText:NSLocalizedString(@"SETTINGS_UNIDENTIFIED_DELIVERY_UNRESTRICTED_ACCESS", @"switch label")
isOn:weakSelf.udManager.shouldAllowUnrestrictedAccessLocal
target:weakSelf
selector:@selector(didToggleUDUnrestrictedAccessSwitch:)];
[unidentifiedDeliverySection addItem:unrestrictedAccessItem];
[contents addSection:unidentifiedDeliverySection];
self.contents = contents;
}
@ -282,6 +306,12 @@ NS_ASSUME_NONNULL_BEGIN
[SignalApp.sharedApp.callService createCallUIAdapter];
}
- (void)didToggleUDUnrestrictedAccessSwitch:(UISwitch *)sender
{
OWSLogInfo(@"toggled to: %@", (sender.isOn ? @"ON" : @"OFF"));
[self.udManager setShouldAllowUnrestrictedAccessLocal:sender.isOn];
}
- (void)show2FASettings
{
OWSLogInfo(@"");

@ -9,8 +9,9 @@ cd $REPO_ROOT
SSK_DIR="./SignalServiceKit/src"
SAE_DIR="./SignalShareExtension"
SM_DIR="./SignalMessaging"
SCK_DIR="../SignalCoreKit"
TARGETS="Signal/src ${SSK_DIR} ${SAE_DIR} ${SM_DIR}"
TARGETS="Signal/src ${SSK_DIR} ${SAE_DIR} ${SM_DIR} ${SCK_DIR}"
TMP="$(mktemp -d)"
STRINGFILE="Signal/translations/en.lproj/Localizable.strings"

@ -2093,6 +2093,15 @@
/* Title for the 'two factor auth' section of the privacy settings. */
"SETTINGS_TWO_FACTOR_AUTH_TITLE" = "Registration Lock";
/* table section footer */
"SETTINGS_UNIDENTIFIED_DELIVERY_SECTION_FOOTER" = "Normally, only users you've shared your profile with can contact you without identifying themselves to the Signal service. Unrestricted Access means *anyone* will be able to contact you without identifying themselves to the Signal service.";
/* table section label */
"SETTINGS_UNIDENTIFIED_DELIVERY_SECTION_TITLE" = "Unidentified Delivery";
/* switch label */
"SETTINGS_UNIDENTIFIED_DELIVERY_UNRESTRICTED_ACCESS" = "Unrestricted Access";
/* No comment provided by engineer. */
"SETTINGS_VERSION" = "Version";

Loading…
Cancel
Save