Settings: LABS: Keep only one flag for cross-signing

This commit is contained in:
manuroe
2020-01-28 16:51:03 +01:00
parent ade2aa4af9
commit 08b1659ff0
4 changed files with 8 additions and 41 deletions
+3 -23
View File
@@ -136,10 +136,8 @@ enum
{
LABS_USE_ROOM_MEMBERS_LAZY_LOADING_INDEX = 0,
LABS_USE_JITSI_WIDGET_INDEX,
LABS_COUNT, // TODO: Remove it once features exist
LABS_DM_KEY_VERIFICATION_INDEX,
LABS_CROSS_SIGNING_INDEX,
// LABS_COUNT
LABS_COUNT
};
enum {
@@ -2429,25 +2427,14 @@ SettingsIdentityServerCoordinatorBridgePresenterDelegate>
cell = labelAndSwitchCell;
}
else if (row == LABS_DM_KEY_VERIFICATION_INDEX)
{
MXKTableViewCellWithLabelAndSwitch* labelAndSwitchCell = [self getLabelAndSwitchCell:tableView forIndexPath:indexPath];
labelAndSwitchCell.mxkLabel.text = NSLocalizedStringFromTable(@"settings_labs_dm_key_verification", @"Vector", nil);
labelAndSwitchCell.mxkSwitch.on = RiotSettings.shared.enableDMKeyVerification;
labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor;
[labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleLabsDMKeyVerification:) forControlEvents:UIControlEventTouchUpInside];
cell = labelAndSwitchCell;
}
else if (row == LABS_CROSS_SIGNING_INDEX)
{
MXKTableViewCellWithLabelAndSwitch* labelAndSwitchCell = [self getLabelAndSwitchCell:tableView forIndexPath:indexPath];
labelAndSwitchCell.mxkLabel.text = NSLocalizedStringFromTable(@"settings_labs_cross_signing", @"Vector", nil);
labelAndSwitchCell.mxkLabel.text = NSLocalizedStringFromTable(@"settings_labs_enable_cross_signing", @"Vector", nil);
labelAndSwitchCell.mxkSwitch.on = RiotSettings.shared.enableCrossSigning;
labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor;
labelAndSwitchCell.mxkSwitch.enabled = YES;
[labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleLabsCrossSigning:) forControlEvents:UIControlEventTouchUpInside];
@@ -3400,13 +3387,6 @@ SettingsIdentityServerCoordinatorBridgePresenterDelegate>
}
}
- (void)toggleLabsDMKeyVerification:(id)sender
{
UISwitch *switchButton = (UISwitch*)sender;
RiotSettings.shared.enableDMKeyVerification = switchButton.isOn;
}
- (void)toggleLabsCrossSigning:(id)sender
{
UISwitch *switchButton = (UISwitch*)sender;