MESSENGER-5203 add federation to lab settings and refactor

This commit is contained in:
JanNiklas Grabowski
2023-11-02 15:35:25 +01:00
parent 5f5aa69a73
commit a213954135
8 changed files with 76 additions and 49 deletions
+26 -1
View File
@@ -234,7 +234,8 @@ typedef NS_ENUM(NSUInteger, LABS_ENABLE)
LABS_ENABLE_NEW_SESSION_MANAGER,
LABS_ENABLE_NEW_CLIENT_INFO_FEATURE,
LABS_ENABLE_WYSIWYG_COMPOSER,
LABS_ENABLE_VOICE_BROADCAST
LABS_ENABLE_VOICE_BROADCAST,
LABS_ENABLE_FEDERATION
};
typedef NS_ENUM(NSUInteger, SECURITY)
@@ -828,6 +829,10 @@ SSOAuthenticationPresenterDelegate>
{
[sectionLabs addRowWithTag:LABS_ENABLE_VOICE_BROADCAST];
*/
// bwi: #5203 add federation feature
[sectionLabs addRowWithTag:LABS_ENABLE_FEDERATION];
sectionLabs.headerTitle = [VectorL10n settingsLabs];
if (sectionLabs.hasAnyRows)
{
@@ -3033,6 +3038,20 @@ SSOAuthenticationPresenterDelegate>
cell = labelAndSwitchCell;
}
// bwi: #5203 add federation feature
else if (row == LABS_ENABLE_FEDERATION)
{
MXKTableViewCellWithLabelAndSwitch *labelAndSwitchCell = [self getLabelAndSwitchCell:tableView forIndexPath:indexPath];
labelAndSwitchCell.mxkLabel.text = [BWIL10n bwiSettingsLabsFederationFeature];
labelAndSwitchCell.mxkSwitch.on = BWIBuildSettings.shared.isFederationEnabled;
labelAndSwitchCell.mxkSwitch.thumbTintColor = ThemeService.shared.theme.backgroundColor;
labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor;
[labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleEnableFederationFeature:) forControlEvents:UIControlEventTouchUpInside];
cell = labelAndSwitchCell;
}
else if (row == LABS_ENABLE_VOICE_BROADCAST)
{
@@ -3974,6 +3993,12 @@ SSOAuthenticationPresenterDelegate>
RiotSettings.shared.roomScreenUseOnlyLatestUserAvatarAndName = sender.isOn;
}
// bwi: #5203 add federation feature
- (void)toggleEnableFederationFeature:(UISwitch *)sender
{
BWIBuildSettings.shared.isFederationEnabled = sender.isOn;
}
- (void)markAllAsRead:(id)sender
{
// Feedback: disable button and run activity indicator