New session manager labs flag (PSG-792) (#6780)

* Add new session manager labs flag

* Add labs flag for client information feature

* Add changelog
This commit is contained in:
ismailgulek
2022-09-30 15:45:20 +03:00
committed by GitHub
parent f8d6f43967
commit 0f9bd7e6a4
7 changed files with 65 additions and 7 deletions
+43 -2
View File
@@ -172,7 +172,9 @@ typedef NS_ENUM(NSUInteger, LABS_ENABLE)
LABS_ENABLE_RINGING_FOR_GROUP_CALLS_INDEX = 0,
LABS_ENABLE_THREADS_INDEX,
LABS_ENABLE_AUTO_REPORT_DECRYPTION_ERRORS,
LABS_ENABLE_LIVE_LOCATION_SHARING
LABS_ENABLE_LIVE_LOCATION_SHARING,
LABS_ENABLE_NEW_SESSION_MANAGER,
LABS_ENABLE_NEW_CLIENT_INFO_FEATURE
};
typedef NS_ENUM(NSUInteger, SECURITY)
@@ -403,7 +405,7 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
Section *sectionSecurity = [Section sectionWithTag:SECTION_TAG_SECURITY];
[sectionSecurity addRowWithTag:SECURITY_BUTTON_INDEX];
if (BuildSettings.deviceManagerEnabled)
if (RiotSettings.shared.enableNewSessionManager)
{
// NOTE: Add device manager entry point in the security section atm for debug purpose
[sectionSecurity addRowWithTag:DEVICE_MANAGER_INDEX];
@@ -595,6 +597,8 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
{
[sectionLabs addRowWithTag:LABS_ENABLE_LIVE_LOCATION_SHARING];
}
[sectionLabs addRowWithTag:LABS_ENABLE_NEW_SESSION_MANAGER];
[sectionLabs addRowWithTag:LABS_ENABLE_NEW_CLIENT_INFO_FEATURE];
sectionLabs.headerTitle = [VectorL10n settingsLabs];
if (sectionLabs.hasAnyRows)
{
@@ -2532,6 +2536,30 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
{
cell = [self buildLiveLocationSharingCellForTableView:tableView atIndexPath:indexPath];
}
else if (row == LABS_ENABLE_NEW_SESSION_MANAGER)
{
MXKTableViewCellWithLabelAndSwitch *labelAndSwitchCell = [self getLabelAndSwitchCell:tableView forIndexPath:indexPath];
labelAndSwitchCell.mxkLabel.text = [VectorL10n settingsLabsEnableNewSessionManager];
labelAndSwitchCell.mxkSwitch.on = RiotSettings.shared.enableNewSessionManager;
labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor;
[labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleEnableNewSessionManager:) forControlEvents:UIControlEventTouchUpInside];
cell = labelAndSwitchCell;
}
else if (row == LABS_ENABLE_NEW_CLIENT_INFO_FEATURE)
{
MXKTableViewCellWithLabelAndSwitch *labelAndSwitchCell = [self getLabelAndSwitchCell:tableView forIndexPath:indexPath];
labelAndSwitchCell.mxkLabel.text = [VectorL10n settingsLabsEnableNewClientInfoFeature];
labelAndSwitchCell.mxkSwitch.on = RiotSettings.shared.enableClientInformationFeature;
labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor;
[labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleEnableNewClientInfoFeature:) forControlEvents:UIControlEventTouchUpInside];
cell = labelAndSwitchCell;
}
}
else if (section == SECTION_TAG_SECURITY)
{
@@ -3277,6 +3305,19 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
[[AppDelegate theDelegate] restoreEmptyDetailsViewController];
}
- (void)toggleEnableNewSessionManager:(UISwitch *)sender
{
RiotSettings.shared.enableNewSessionManager = sender.isOn;
[self updateSections];
}
- (void)toggleEnableNewClientInfoFeature:(UISwitch *)sender
{
BOOL isEnabled = sender.isOn;
RiotSettings.shared.enableClientInformationFeature = isEnabled;
MXSDKOptions.sharedInstance.enableNewClientInformationFeature = isEnabled;
}
- (void)togglePinRoomsWithMissedNotif:(UISwitch *)sender
{
RiotSettings.shared.pinRoomsWithMissedNotificationsOnHome = sender.isOn;