@ -82,36 +82,39 @@ static NSString *const kSealedSenderInfoURL = @"https://signal.org/blog/sealed-s
__weak PrivacySettingsTableViewController * weakSelf = self ;
OWSTableSection * blocklistSection = [ OWSTableSection new ] ;
blocklistSection . headerTitle
= NSLocalizedString ( @ "SETTINGS_BLOCK_LIST_TITLE ", @ "Label for the block list section of the settings view ") ;
[ blocklistSection
addItem : [ OWSTableItem disclosureItemWithText : NSLocalizedString ( @ "SETTINGS_BLOCK_LIST_TITLE ",
@ "Label for the block list section of the settings view ")
accessibilityIdentifier : [ NSString stringWithFormat : @ "settings . privacy . %@", @"blocklist"]
actionBlock : ^{
[ weakSelf showBlocklist ] ;
} ] ] ;
[ contents addSection : blocklistSection ] ;
OWSTableSection * readReceiptsSection = [ OWSTableSection new ] ;
readReceiptsSection . headerTitle
= NSLocalizedString ( @ "SETTINGS_READ_RECEIPT ", @ "Label for the ' read receipts' setting . ") ;
readReceiptsSection . footerTitle = NSLocalizedString (
@ "SETTINGS_READ_RECEIPTS_SECTION_FOOTER ", @ "An explanation of the ' read receipts' setting . ") ;
[ readReceiptsSection
addItem : [ OWSTableItem switchItemWithText : NSLocalizedString ( @ "SETTINGS_READ_RECEIPT ",
@ "Label for the ' read receipts' setting . ")
accessibilityIdentifier : [ NSString stringWithFormat : @ "settings . privacy . %@", @"read_receipts"]
isOnBlock : ^{
return [ OWSReadReceiptManager . sharedManager areReadReceiptsEnabled ] ;
}
isEnabledBlock : ^{
return YES ;
}
target : weakSelf
selector : @ selector ( didToggleReadReceiptsSwitch : ) ] ] ;
[ contents addSection : readReceiptsSection ] ;
/ / Loki : Original code
/ / == == == ==
/ / OWSTableSection * blocklistSection = [ OWSTableSection new ] ;
/ / blocklistSection . headerTitle
/ / = NSLocalizedString ( @ "SETTINGS_BLOCK_LIST_TITLE ", @ "Label for the block list section of the settings view ") ;
/ / [ blocklistSection
/ / addItem : [ OWSTableItem disclosureItemWithText : NSLocalizedString ( @ "SETTINGS_BLOCK_LIST_TITLE ",
/ / @ "Label for the block list section of the settings view ")
/ / accessibilityIdentifier : [ NSString stringWithFormat : @ "settings . privacy . %@", @"blocklist"]
/ / actionBlock : ^{
/ / [ weakSelf showBlocklist ] ;
/ / } ] ] ;
/ / [ contents addSection : blocklistSection ] ;
/ /
/ / OWSTableSection * readReceiptsSection = [ OWSTableSection new ] ;
/ / readReceiptsSection . headerTitle
/ / = NSLocalizedString ( @ "SETTINGS_READ_RECEIPT ", @ "Label for the ' read receipts' setting . ") ;
/ / readReceiptsSection . footerTitle = NSLocalizedString (
/ / @ "SETTINGS_READ_RECEIPTS_SECTION_FOOTER ", @ "An explanation of the ' read receipts' setting . ") ;
/ / [ readReceiptsSection
/ / addItem : [ OWSTableItem switchItemWithText : NSLocalizedString ( @ "SETTINGS_READ_RECEIPT ",
/ / @ "Label for the ' read receipts' setting . ")
/ / accessibilityIdentifier : [ NSString stringWithFormat : @ "settings . privacy . %@", @"read_receipts"]
/ / isOnBlock : ^{
/ / return [ OWSReadReceiptManager . sharedManager areReadReceiptsEnabled ] ;
/ / }
/ / isEnabledBlock : ^{
/ / return YES ;
/ / }
/ / target : weakSelf
/ / selector : @ selector ( didToggleReadReceiptsSwitch : ) ] ] ;
/ / [ contents addSection : readReceiptsSection ] ;
/ / == == == ==
OWSTableSection * typingIndicatorsSection = [ OWSTableSection new ] ;
typingIndicatorsSection . headerTitle
@ -135,8 +138,7 @@ static NSString *const kSealedSenderInfoURL = @"https://signal.org/blog/sealed-s
OWSTableSection * screenLockSection = [ OWSTableSection new ] ;
screenLockSection . headerTitle = NSLocalizedString (
@ "SETTINGS_SCREEN_LOCK_SECTION_TITLE ", @ "Title for the ' screen lock' section of the privacy settings . ") ;
screenLockSection . footerTitle = NSLocalizedString (
@ "SETTINGS_SCREEN_LOCK_SECTION_FOOTER ", @ "Footer for the ' screen lock' section of the privacy settings . ") ;
screenLockSection . footerTitle = NSLocalizedString ( @ "Unlock Loki Messenger ' s screen using Touch ID , Face ID , or your iOS device passcode . You can still answer incoming calls and receive message notifications while Screen Lock is enabled . Loki Messenger ' s notification settings allow you to customize the information that is displayed . ", @ "") ;
[ screenLockSection
addItem : [ OWSTableItem
switchItemWithText : NSLocalizedString ( @ "SETTINGS_SCREEN_LOCK_SWITCH_LABEL ",
@ -172,7 +174,7 @@ static NSString *const kSealedSenderInfoURL = @"https://signal.org/blog/sealed-s
OWSTableSection * screenSecuritySection = [ OWSTableSection new ] ;
screenSecuritySection . headerTitle = NSLocalizedString ( @ "SETTINGS_SECURITY_TITLE ", @ "Section header ") ;
screenSecuritySection . footerTitle = NSLocalizedString ( @ "SETTINGS_SCREEN_SECURITY_DETAIL ", nil ) ;
screenSecuritySection . footerTitle = NSLocalizedString ( @ "Prevent Loki Messenger previews from appearing in the app switcher . ", nil ) ;
[ screenSecuritySection
addItem : [ OWSTableItem switchItemWithText : NSLocalizedString ( @ "SETTINGS_SCREEN_SECURITY ", @ "")
accessibilityIdentifier : [ NSString stringWithFormat : @ "settings . privacy . %@", @"screen_security"]
@ -186,100 +188,103 @@ static NSString *const kSealedSenderInfoURL = @"https://signal.org/blog/sealed-s
selector : @ selector ( didToggleScreenSecuritySwitch : ) ] ] ;
[ contents addSection : screenSecuritySection ] ;
/ / Allow calls to connect directly vs . using TURN exclusively
OWSTableSection * callingSection = [ OWSTableSection new ] ;
callingSection . headerTitle
= NSLocalizedString ( @ "SETTINGS_SECTION_TITLE_CALLING ", @ "settings topic header for table section ") ;
callingSection . footerTitle = NSLocalizedString ( @ "SETTINGS_CALLING_HIDES_IP_ADDRESS_PREFERENCE_TITLE_DETAIL ",
@ "User settings section footer , a detailed explanation ") ;
[ callingSection addItem : [ OWSTableItem switchItemWithText : NSLocalizedString (
@ "SETTINGS_CALLING_HIDES_IP_ADDRESS_PREFERENCE_TITLE ",
@ "Table cell label ")
accessibilityIdentifier : [ NSString stringWithFormat : @ "settings . privacy . %@",
@ "calling_hide_ip_address "]
isOnBlock : ^{
return [ Environment . shared . preferences doCallsHideIPAddress ] ;
}
isEnabledBlock : ^{
return YES ;
}
target : weakSelf
selector : @ selector ( didToggleCallsHideIPAddressSwitch : ) ] ] ;
[ contents addSection : callingSection ] ;
if ( CallUIAdapter . isCallkitDisabledForLocale ) {
/ / Hide all CallKit - related prefs ; CallKit is disabled .
} else if ( @ available ( iOS 11 , * ) ) {
OWSTableSection * callKitSection = [ OWSTableSection new ] ;
[ callKitSection
addItem : [ OWSTableItem switchItemWithText : NSLocalizedString (
@ "SETTINGS_PRIVACY_CALLKIT_SYSTEM_CALL_LOG_PREFERENCE_TITLE ",
@ "Short table cell label ")
accessibilityIdentifier : [ NSString stringWithFormat : @ "settings . privacy . %@", @"callkit_history"]
isOnBlock : ^{
return [ Environment . shared . preferences isSystemCallLogEnabled ] ;
}
isEnabledBlock : ^{
return YES ;
}
target : weakSelf
selector : @ selector ( didToggleEnableSystemCallLogSwitch : ) ] ] ;
callKitSection . footerTitle = NSLocalizedString (
@ "SETTINGS_PRIVACY_CALLKIT_SYSTEM_CALL_LOG_PREFERENCE_DESCRIPTION ", @ "Settings table section footer . ") ;
[ contents addSection : callKitSection ] ;
} else if ( @ available ( iOS 10 , * ) ) {
OWSTableSection * callKitSection = [ OWSTableSection new ] ;
callKitSection . footerTitle
= NSLocalizedString ( @ "SETTINGS_SECTION_CALL_KIT_DESCRIPTION ", @ "Settings table section footer . ") ;
[ callKitSection
addItem : [ OWSTableItem switchItemWithText : NSLocalizedString (
@ "SETTINGS_PRIVACY_CALLKIT_TITLE ", @ "Short table cell label ")
accessibilityIdentifier : [ NSString stringWithFormat : @ "settings . privacy . %@", @"callkit"]
isOnBlock : ^{
return [ Environment . shared . preferences isCallKitEnabled ] ;
}
isEnabledBlock : ^{
return YES ;
}
target : weakSelf
selector : @ selector ( didToggleEnableCallKitSwitch : ) ] ] ;
if ( self . preferences . isCallKitEnabled ) {
[ callKitSection
addItem : [ OWSTableItem switchItemWithText : NSLocalizedString ( @ "SETTINGS_PRIVACY_CALLKIT_PRIVACY_TITLE ",
@ "Label for ' CallKit privacy' preference ")
accessibilityIdentifier : [ NSString
stringWithFormat : @ "settings . privacy . %@", @"callkit_privacy"]
isOnBlock : ^{
return ( BOOL ) ![ Environment . shared . preferences isCallKitPrivacyEnabled ] ;
}
isEnabledBlock : ^{
return YES ;
}
target : weakSelf
selector : @ selector ( didToggleEnableCallKitPrivacySwitch : ) ] ] ;
}
[ contents addSection : callKitSection ] ;
}
OWSTableSection * twoFactorAuthSection = [ OWSTableSection new ] ;
twoFactorAuthSection . headerTitle = NSLocalizedString (
@ "SETTINGS_TWO_FACTOR_AUTH_TITLE ", @ "Title for the ' two factor auth' section of the privacy settings . ") ;
[ twoFactorAuthSection
addItem :
[ OWSTableItem
disclosureItemWithText : NSLocalizedString ( @ "SETTINGS_TWO_FACTOR_AUTH_ITEM ",
@ "Label for the ' two factor auth' item of the privacy settings . ")
detailText :
( [ OWS2FAManager . sharedManager is2FAEnabled ]
? NSLocalizedString ( @ "SETTINGS_TWO_FACTOR_AUTH_ENABLED ",
@ "Indicates that ' two factor auth' is enabled in the privacy settings . ")
: NSLocalizedString ( @ "SETTINGS_TWO_FACTOR_AUTH_DISABLED ",
@ "Indicates that ' two factor auth' is disabled in the privacy settings . ") )
accessibilityIdentifier : [ NSString stringWithFormat : @ "settings . privacy . %@", @"2fa"]
actionBlock : ^{
[ weakSelf show2FASettings ] ;
} ] ] ;
[ contents addSection : twoFactorAuthSection ] ;
/ / Loki : Original code
/ / == == == ==
/ / / / Allow calls to connect directly vs . using TURN exclusively
/ / OWSTableSection * callingSection = [ OWSTableSection new ] ;
/ / callingSection . headerTitle
/ / = NSLocalizedString ( @ "SETTINGS_SECTION_TITLE_CALLING ", @ "settings topic header for table section ") ;
/ / callingSection . footerTitle = NSLocalizedString ( @ "SETTINGS_CALLING_HIDES_IP_ADDRESS_PREFERENCE_TITLE_DETAIL ",
/ / @ "User settings section footer , a detailed explanation ") ;
/ / [ callingSection addItem : [ OWSTableItem switchItemWithText : NSLocalizedString (
/ / @ "SETTINGS_CALLING_HIDES_IP_ADDRESS_PREFERENCE_TITLE ",
/ / @ "Table cell label ")
/ / accessibilityIdentifier : [ NSString stringWithFormat : @ "settings . privacy . %@",
/ / @ "calling_hide_ip_address "]
/ / isOnBlock : ^{
/ / return [ Environment . shared . preferences doCallsHideIPAddress ] ;
/ / }
/ / isEnabledBlock : ^{
/ / return YES ;
/ / }
/ / target : weakSelf
/ / selector : @ selector ( didToggleCallsHideIPAddressSwitch : ) ] ] ;
/ / [ contents addSection : callingSection ] ;
/ /
/ / if ( CallUIAdapter . isCallkitDisabledForLocale ) {
/ / / / Hide all CallKit - related prefs ; CallKit is disabled .
/ / } else if ( @ available ( iOS 11 , * ) ) {
/ / OWSTableSection * callKitSection = [ OWSTableSection new ] ;
/ / [ callKitSection
/ / addItem : [ OWSTableItem switchItemWithText : NSLocalizedString (
/ / @ "SETTINGS_PRIVACY_CALLKIT_SYSTEM_CALL_LOG_PREFERENCE_TITLE ",
/ / @ "Short table cell label ")
/ / accessibilityIdentifier : [ NSString stringWithFormat : @ "settings . privacy . %@", @"callkit_history"]
/ / isOnBlock : ^{
/ / return [ Environment . shared . preferences isSystemCallLogEnabled ] ;
/ / }
/ / isEnabledBlock : ^{
/ / return YES ;
/ / }
/ / target : weakSelf
/ / selector : @ selector ( didToggleEnableSystemCallLogSwitch : ) ] ] ;
/ / callKitSection . footerTitle = NSLocalizedString (
/ / @ "SETTINGS_PRIVACY_CALLKIT_SYSTEM_CALL_LOG_PREFERENCE_DESCRIPTION ", @ "Settings table section footer . ") ;
/ / [ contents addSection : callKitSection ] ;
/ / } else if ( @ available ( iOS 10 , * ) ) {
/ / OWSTableSection * callKitSection = [ OWSTableSection new ] ;
/ / callKitSection . footerTitle
/ / = NSLocalizedString ( @ "SETTINGS_SECTION_CALL_KIT_DESCRIPTION ", @ "Settings table section footer . ") ;
/ / [ callKitSection
/ / addItem : [ OWSTableItem switchItemWithText : NSLocalizedString (
/ / @ "SETTINGS_PRIVACY_CALLKIT_TITLE ", @ "Short table cell label ")
/ / accessibilityIdentifier : [ NSString stringWithFormat : @ "settings . privacy . %@", @"callkit"]
/ / isOnBlock : ^{
/ / return [ Environment . shared . preferences isCallKitEnabled ] ;
/ / }
/ / isEnabledBlock : ^{
/ / return YES ;
/ / }
/ / target : weakSelf
/ / selector : @ selector ( didToggleEnableCallKitSwitch : ) ] ] ;
/ / if ( self . preferences . isCallKitEnabled ) {
/ / [ callKitSection
/ / addItem : [ OWSTableItem switchItemWithText : NSLocalizedString ( @ "SETTINGS_PRIVACY_CALLKIT_PRIVACY_TITLE ",
/ / @ "Label for ' CallKit privacy' preference ")
/ / accessibilityIdentifier : [ NSString
/ / stringWithFormat : @ "settings . privacy . %@", @"callkit_privacy"]
/ / isOnBlock : ^{
/ / return ( BOOL ) ![ Environment . shared . preferences isCallKitPrivacyEnabled ] ;
/ / }
/ / isEnabledBlock : ^{
/ / return YES ;
/ / }
/ / target : weakSelf
/ / selector : @ selector ( didToggleEnableCallKitPrivacySwitch : ) ] ] ;
/ / }
/ / [ contents addSection : callKitSection ] ;
/ / }
/ /
/ / OWSTableSection * twoFactorAuthSection = [ OWSTableSection new ] ;
/ / twoFactorAuthSection . headerTitle = NSLocalizedString (
/ / @ "SETTINGS_TWO_FACTOR_AUTH_TITLE ", @ "Title for the ' two factor auth' section of the privacy settings . ") ;
/ / [ twoFactorAuthSection
/ / addItem :
/ / [ OWSTableItem
/ / disclosureItemWithText : NSLocalizedString ( @ "SETTINGS_TWO_FACTOR_AUTH_ITEM ",
/ / @ "Label for the ' two factor auth' item of the privacy settings . ")
/ / detailText :
/ / ( [ OWS2FAManager . sharedManager is2FAEnabled ]
/ / ? NSLocalizedString ( @ "SETTINGS_TWO_FACTOR_AUTH_ENABLED ",
/ / @ "Indicates that ' two factor auth' is enabled in the privacy settings . ")
/ / : NSLocalizedString ( @ "SETTINGS_TWO_FACTOR_AUTH_DISABLED ",
/ / @ "Indicates that ' two factor auth' is disabled in the privacy settings . ") )
/ / accessibilityIdentifier : [ NSString stringWithFormat : @ "settings . privacy . %@", @"2fa"]
/ / actionBlock : ^{
/ / [ weakSelf show2FASettings ] ;
/ / } ] ] ;
/ / [ contents addSection : twoFactorAuthSection ] ;
/ / == == == ==
OWSTableSection * historyLogsSection = [ OWSTableSection new ] ;
historyLogsSection . headerTitle = NSLocalizedString ( @ "SETTINGS_HISTORYLOG_TITLE ", @ "Section header ") ;
@ -291,95 +296,98 @@ static NSString *const kSealedSenderInfoURL = @"https://signal.org/blog/sealed-s
} ] ] ;
[ contents addSection : historyLogsSection ] ;
OWSTableSection * unidentifiedDeliveryIndicatorsSection = [ OWSTableSection new ] ;
unidentifiedDeliveryIndicatorsSection . headerTitle
= NSLocalizedString ( @ "SETTINGS_UNIDENTIFIED_DELIVERY_SECTION_TITLE ", @ "table section label ") ;
[ unidentifiedDeliveryIndicatorsSection
addItem : [ OWSTableItem
itemWithCustomCellBlock : ^UITableViewCell * {
UITableViewCell * cell = [ [ UITableViewCell alloc ] initWithStyle : UITableViewCellStyleValue1
reuseIdentifier : @ "UITableViewCellStyleValue1 "] ;
[ OWSTableItem configureCell : cell ] ;
cell . preservesSuperviewLayoutMargins = YES ;
cell . contentView . preservesSuperviewLayoutMargins = YES ;
cell . selectionStyle = UITableViewCellSelectionStyleNone ;
UILabel * label = [ UILabel new ] ;
label . text
= NSLocalizedString ( @ "SETTINGS_UNIDENTIFIED_DELIVERY_SHOW_INDICATORS ", @ "switch label ") ;
label . font = [ UIFont ows_regularFontWithSize : 18. f ] ;
label . textColor = [ Theme primaryColor ] ;
[ label setContentHuggingHorizontalHigh ] ;
UIImage * icon = [ UIImage imageNamed : @ "ic_secret_sender_indicator "] ;
UIImageView * iconView = [ [ UIImageView alloc ]
initWithImage : [ icon imageWithRenderingMode : UIImageRenderingModeAlwaysTemplate ] ] ;
iconView . tintColor = Theme . secondaryColor ;
[ iconView setContentHuggingHorizontalHigh ] ;
UIView * spacer = [ UIView new ] ;
[ spacer setContentHuggingHorizontalLow ] ;
UISwitch * cellSwitch = [ UISwitch new ] ;
cell . accessoryView = cellSwitch ;
[ cellSwitch setOn : Environment . shared . preferences . shouldShowUnidentifiedDeliveryIndicators ] ;
[ cellSwitch addTarget : weakSelf
action : @ selector ( didToggleUDShowIndicatorsSwitch : )
forControlEvents : UIControlEventValueChanged ] ;
[ cellSwitch setContentHuggingHorizontalHigh ] ;
cellSwitch . accessibilityIdentifier =
[ NSString stringWithFormat : @ "settings . privacy . %@", @"sealed_sender"];
UIStackView * stackView =
[ [ UIStackView alloc ] initWithArrangedSubviews : @ [ label , iconView , spacer , cellSwitch ] ] ;
stackView . axis = UILayoutConstraintAxisHorizontal ;
stackView . spacing = 10 ;
stackView . alignment = UIStackViewAlignmentCenter ;
[ cell . contentView addSubview : stackView ] ;
[ stackView ows_autoPinToSuperviewMargins ] ;
return cell ;
}
customRowHeight : UITableViewAutomaticDimension
actionBlock : ^{
NSURL * url = [ NSURL URLWithString : kSealedSenderInfoURL ] ;
OWSCAssertDebug ( url ) ;
[ UIApplication . sharedApplication openURL : url ] ;
} ] ] ;
unidentifiedDeliveryIndicatorsSection . footerTitle
= NSLocalizedString ( @ "SETTINGS_UNIDENTIFIED_DELIVERY_SHOW_INDICATORS_FOOTER ", @ "table section footer ") ;
[ contents addSection : unidentifiedDeliveryIndicatorsSection ] ;
OWSTableSection * unidentifiedDeliveryUnrestrictedSection = [ OWSTableSection new ] ;
OWSTableItem * unrestrictedAccessItem = [ OWSTableItem
switchItemWithText : NSLocalizedString ( @ "SETTINGS_UNIDENTIFIED_DELIVERY_UNRESTRICTED_ACCESS ", @ "switch label ")
accessibilityIdentifier : [ NSString stringWithFormat : @ "settings . privacy . %@", @"sealed_sender_unrestricted"]
isOnBlock : ^{
return [ SSKEnvironment . shared . udManager shouldAllowUnrestrictedAccessLocal ] ;
}
isEnabledBlock : ^{
return YES ;
}
target : weakSelf
selector : @ selector ( didToggleUDUnrestrictedAccessSwitch : ) ] ;
[ unidentifiedDeliveryUnrestrictedSection addItem : unrestrictedAccessItem ] ;
unidentifiedDeliveryUnrestrictedSection . footerTitle
= NSLocalizedString ( @ "SETTINGS_UNIDENTIFIED_DELIVERY_UNRESTRICTED_ACCESS_FOOTER ", @ "table section footer ") ;
[ contents addSection : unidentifiedDeliveryUnrestrictedSection ] ;
OWSTableSection * unidentifiedDeliveryLearnMoreSection = [ OWSTableSection new ] ;
[ unidentifiedDeliveryLearnMoreSection
addItem : [ OWSTableItem disclosureItemWithText : NSLocalizedString ( @ "SETTINGS_UNIDENTIFIED_DELIVERY_LEARN_MORE ",
@ "Label for a link to more info about unidentified delivery . ")
accessibilityIdentifier : [ NSString stringWithFormat : @ "settings . privacy . %@",
@ "sealed_sender_learn_more "]
actionBlock : ^{
NSURL * url = [ NSURL URLWithString : kSealedSenderInfoURL ] ;
OWSCAssertDebug ( url ) ;
[ UIApplication . sharedApplication openURL : url ] ;
} ] ] ;
[ contents addSection : unidentifiedDeliveryLearnMoreSection ] ;
/ / Loki : Original code
/ / == == == ==
/ / OWSTableSection * unidentifiedDeliveryIndicatorsSection = [ OWSTableSection new ] ;
/ / unidentifiedDeliveryIndicatorsSection . headerTitle
/ / = NSLocalizedString ( @ "SETTINGS_UNIDENTIFIED_DELIVERY_SECTION_TITLE ", @ "table section label ") ;
/ / [ unidentifiedDeliveryIndicatorsSection
/ / addItem : [ OWSTableItem
/ / itemWithCustomCellBlock : ^UITableViewCell * {
/ / UITableViewCell * cell = [ [ UITableViewCell alloc ] initWithStyle : UITableViewCellStyleValue1
/ / reuseIdentifier : @ "UITableViewCellStyleValue1 "] ;
/ / [ OWSTableItem configureCell : cell ] ;
/ / cell . preservesSuperviewLayoutMargins = YES ;
/ / cell . contentView . preservesSuperviewLayoutMargins = YES ;
/ / cell . selectionStyle = UITableViewCellSelectionStyleNone ;
/ /
/ / UILabel * label = [ UILabel new ] ;
/ / label . text
/ / = NSLocalizedString ( @ "SETTINGS_UNIDENTIFIED_DELIVERY_SHOW_INDICATORS ", @ "switch label ") ;
/ / label . font = [ UIFont ows_regularFontWithSize : 18. f ] ;
/ / label . textColor = [ Theme primaryColor ] ;
/ / [ label setContentHuggingHorizontalHigh ] ;
/ /
/ / UIImage * icon = [ UIImage imageNamed : @ "ic_secret_sender_indicator "] ;
/ / UIImageView * iconView = [ [ UIImageView alloc ]
/ / initWithImage : [ icon imageWithRenderingMode : UIImageRenderingModeAlwaysTemplate ] ] ;
/ / iconView . tintColor = Theme . secondaryColor ;
/ / [ iconView setContentHuggingHorizontalHigh ] ;
/ /
/ / UIView * spacer = [ UIView new ] ;
/ / [ spacer setContentHuggingHorizontalLow ] ;
/ /
/ / UISwitch * cellSwitch = [ UISwitch new ] ;
/ / cell . accessoryView = cellSwitch ;
/ / [ cellSwitch setOn : Environment . shared . preferences . shouldShowUnidentifiedDeliveryIndicators ] ;
/ / [ cellSwitch addTarget : weakSelf
/ / action : @ selector ( didToggleUDShowIndicatorsSwitch : )
/ / forControlEvents : UIControlEventValueChanged ] ;
/ / [ cellSwitch setContentHuggingHorizontalHigh ] ;
/ / cellSwitch . accessibilityIdentifier =
/ / [ NSString stringWithFormat : @ "settings . privacy . %@", @"sealed_sender"];
/ /
/ / UIStackView * stackView =
/ / [ [ UIStackView alloc ] initWithArrangedSubviews : @ [ label , iconView , spacer , cellSwitch ] ] ;
/ / stackView . axis = UILayoutConstraintAxisHorizontal ;
/ / stackView . spacing = 10 ;
/ / stackView . alignment = UIStackViewAlignmentCenter ;
/ /
/ / [ cell . contentView addSubview : stackView ] ;
/ / [ stackView ows_autoPinToSuperviewMargins ] ;
/ / return cell ;
/ / }
/ / customRowHeight : UITableViewAutomaticDimension
/ / actionBlock : ^{
/ / NSURL * url = [ NSURL URLWithString : kSealedSenderInfoURL ] ;
/ / OWSCAssertDebug ( url ) ;
/ / [ UIApplication . sharedApplication openURL : url ] ;
/ / } ] ] ;
/ /
/ / unidentifiedDeliveryIndicatorsSection . footerTitle
/ / = NSLocalizedString ( @ "SETTINGS_UNIDENTIFIED_DELIVERY_SHOW_INDICATORS_FOOTER ", @ "table section footer ") ;
/ / [ contents addSection : unidentifiedDeliveryIndicatorsSection ] ;
/ /
/ / OWSTableSection * unidentifiedDeliveryUnrestrictedSection = [ OWSTableSection new ] ;
/ / OWSTableItem * unrestrictedAccessItem = [ OWSTableItem
/ / switchItemWithText : NSLocalizedString ( @ "SETTINGS_UNIDENTIFIED_DELIVERY_UNRESTRICTED_ACCESS ", @ "switch label ")
/ / accessibilityIdentifier : [ NSString stringWithFormat : @ "settings . privacy . %@", @"sealed_sender_unrestricted"]
/ / isOnBlock : ^{
/ / return [ SSKEnvironment . shared . udManager shouldAllowUnrestrictedAccessLocal ] ;
/ / }
/ / isEnabledBlock : ^{
/ / return YES ;
/ / }
/ / target : weakSelf
/ / selector : @ selector ( didToggleUDUnrestrictedAccessSwitch : ) ] ;
/ / [ unidentifiedDeliveryUnrestrictedSection addItem : unrestrictedAccessItem ] ;
/ / unidentifiedDeliveryUnrestrictedSection . footerTitle
/ / = NSLocalizedString ( @ "SETTINGS_UNIDENTIFIED_DELIVERY_UNRESTRICTED_ACCESS_FOOTER ", @ "table section footer ") ;
/ / [ contents addSection : unidentifiedDeliveryUnrestrictedSection ] ;
/ /
/ / OWSTableSection * unidentifiedDeliveryLearnMoreSection = [ OWSTableSection new ] ;
/ / [ unidentifiedDeliveryLearnMoreSection
/ / addItem : [ OWSTableItem disclosureItemWithText : NSLocalizedString ( @ "SETTINGS_UNIDENTIFIED_DELIVERY_LEARN_MORE ",
/ / @ "Label for a link to more info about unidentified delivery . ")
/ / accessibilityIdentifier : [ NSString stringWithFormat : @ "settings . privacy . %@",
/ / @ "sealed_sender_learn_more "]
/ / actionBlock : ^{
/ / NSURL * url = [ NSURL URLWithString : kSealedSenderInfoURL ] ;
/ / OWSCAssertDebug ( url ) ;
/ / [ UIApplication . sharedApplication openURL : url ] ;
/ / } ] ] ;
/ / [ contents addSection : unidentifiedDeliveryLearnMoreSection ] ;
/ / == == == ==
OWSTableSection * linkPreviewsSection = [ OWSTableSection new ] ;
[ linkPreviewsSection