mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-17 15:09:31 +02:00
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:
@@ -420,8 +420,4 @@ final class BuildSettings: NSObject {
|
||||
|
||||
// MARK: - New App Layout
|
||||
static let newAppLayoutEnabled = true
|
||||
|
||||
// MARK: - Device manager
|
||||
|
||||
static let deviceManagerEnabled = false
|
||||
}
|
||||
|
||||
@@ -89,6 +89,8 @@ class CommonConfiguration: NSObject, Configurable {
|
||||
sdkOptions.authEnableRefreshTokens = BuildSettings.authEnableRefreshTokens
|
||||
// Configure key provider delegate
|
||||
MXKeyProvider.sharedInstance().delegate = EncryptionKeyManager.shared
|
||||
|
||||
sdkOptions.enableNewClientInformationFeature = RiotSettings.shared.enableClientInformationFeature
|
||||
}
|
||||
|
||||
private func makeASCIIUserAgent() -> String? {
|
||||
|
||||
@@ -762,6 +762,8 @@ Tap the + to start adding people.";
|
||||
"settings_labs_enable_auto_report_decryption_errors" = "Auto Report Decryption Errors";
|
||||
"settings_labs_use_only_latest_user_avatar_and_name" = "Show latest avatar and name for users in message history";
|
||||
"settings_labs_enable_live_location_sharing" = "Live location sharing - share current location (active development, and temporarily, locations persist in room history)";
|
||||
"settings_labs_enable_new_session_manager" = "New session manager";
|
||||
"settings_labs_enable_new_client_info_feature" = "Record the client name, version, and url to recognise sessions more easily in session manager";
|
||||
"settings_labs_enable_new_app_layout" = "New Application Layout";
|
||||
|
||||
"settings_version" = "Version %@";
|
||||
|
||||
@@ -7379,6 +7379,14 @@ public class VectorL10n: NSObject {
|
||||
public static var settingsLabsEnableNewAppLayout: String {
|
||||
return VectorL10n.tr("Vector", "settings_labs_enable_new_app_layout")
|
||||
}
|
||||
/// Record the client name, version, and url to recognise sessions more easily in session manager
|
||||
public static var settingsLabsEnableNewClientInfoFeature: String {
|
||||
return VectorL10n.tr("Vector", "settings_labs_enable_new_client_info_feature")
|
||||
}
|
||||
/// New session manager
|
||||
public static var settingsLabsEnableNewSessionManager: String {
|
||||
return VectorL10n.tr("Vector", "settings_labs_enable_new_session_manager")
|
||||
}
|
||||
/// Ring for group calls
|
||||
public static var settingsLabsEnableRingingForGroupCalls: String {
|
||||
return VectorL10n.tr("Vector", "settings_labs_enable_ringing_for_group_calls")
|
||||
|
||||
@@ -163,7 +163,15 @@ final class RiotSettings: NSObject {
|
||||
NotificationCenter.default.post(name: RiotSettings.didUpdateLiveLocationSharingActivation, object: self)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Flag indicating if the new session manager is enabled
|
||||
@UserDefault(key: "enableNewSessionManager", defaultValue: false, storage: defaults)
|
||||
var enableNewSessionManager
|
||||
|
||||
/// Flag indicating if the new client information feature is enabled
|
||||
@UserDefault(key: "enableClientInformationFeature", defaultValue: false, storage: defaults)
|
||||
var enableClientInformationFeature
|
||||
|
||||
// MARK: Calls
|
||||
|
||||
/// Indicate if `allowStunServerFallback` settings has been set once.
|
||||
|
||||
@@ -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;
|
||||
|
||||
1
changelog.d/pr-6780.change
Normal file
1
changelog.d/pr-6780.change
Normal file
@@ -0,0 +1 @@
|
||||
Settings: Add labs flags for new session manager (PSG-792, PSG-799).
|
||||
Reference in New Issue
Block a user