Merge commit 'a8c505c2f9175ae0bece1f62708e6fc31e587897' into feature/3746_merge_element_1.9.10

# Conflicts:
#	Config/AppConfiguration.swift
#	Config/AppVersion.xcconfig
#	Podfile.lock
#	Riot/Modules/Application/AppCoordinator.swift
#	Riot/Modules/Common/Avatar/AvatarView.swift
#	Riot/Modules/Room/TimelineCells/Styles/Bubble/BubbleRoomTimelineCellProvider.m
#	Riot/Modules/Room/TimelineCells/Styles/Plain/PlainRoomTimelineCellProvider.m
#	Riot/Modules/Settings/Security/SecurityViewController.m
#	Riot/Modules/Settings/SettingsViewController.m
#	Riot/Modules/TabBar/TabBarCoordinator.swift
#	Riot/target.yml
#	fastlane/Fastfile
#	project.yml
This commit is contained in:
Frank Rotermund
2022-11-02 14:05:36 +01:00
467 changed files with 18708 additions and 2131 deletions
+70 -132
View File
@@ -224,7 +224,9 @@ typedef NS_ENUM(NSUInteger, LABS_ENABLE)
LABS_ENABLE_AUTO_REPORT_DECRYPTION_ERRORS,
LABS_ENABLE_LIVE_LOCATION_SHARING,
LABS_ENABLE_NEW_SESSION_MANAGER,
LABS_ENABLE_NEW_CLIENT_INFO_FEATURE
LABS_ENABLE_NEW_CLIENT_INFO_FEATURE,
LABS_ENABLE_WYSIWYG_COMPOSER,
LABS_ENABLE_VOICE_BROADCAST
};
typedef NS_ENUM(NSUInteger, SECURITY)
@@ -249,8 +251,7 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(void);
@interface SettingsViewController () <UITextFieldDelegate, MXKCountryPickerViewControllerDelegate, MXKLanguagePickerViewControllerDelegate, DeactivateAccountViewControllerDelegate,
NotificationSettingsCoordinatorBridgePresenterDelegate,
SecureBackupSetupCoordinatorBridgePresenterDelegate,
SignOutAlertPresenterDelegate,
SignOutFlowPresenterDelegate,
SingleImagePickerPresenterDelegate,
SettingsDiscoveryTableViewSectionDelegate, SettingsDiscoveryViewModelCoordinatorDelegate,
SettingsIdentityServerCoordinatorBridgePresenterDelegate,
@@ -329,7 +330,7 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
@property (nonatomic, strong) NotificationSettingsCoordinatorBridgePresenter *notificationSettingsBridgePresenter;
@property (nonatomic, strong) SignOutAlertPresenter *signOutAlertPresenter;
@property (nonatomic, strong) SignOutFlowPresenter *signOutFlowPresenter;
@property (nonatomic, weak) UIButton *signOutButton;
@property (nonatomic, strong) SingleImagePickerPresenter *imagePickerPresenter;
@@ -337,12 +338,8 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
@property (nonatomic, strong) SettingsDiscoveryTableViewSection *settingsDiscoveryTableViewSection;
@property (nonatomic, strong) SettingsDiscoveryThreePidDetailsCoordinatorBridgePresenter *discoveryThreePidDetailsPresenter;
@property (nonatomic, strong) SecureBackupSetupCoordinatorBridgePresenter *secureBackupSetupCoordinatorBridgePresenter;
@property (nonatomic, strong) TableViewSections *tableViewSections;
@property (nonatomic, strong) CrossSigningSetupCoordinatorBridgePresenter *crossSigningSetupCoordinatorBridgePresenter;
@property (nonatomic, strong) ReauthenticationCoordinatorBridgePresenter *reauthenticationCoordinatorBridgePresenter;
@property (nonatomic, strong) UserInteractiveAuthenticationService *userInteractiveAuthenticationService;
@@ -750,6 +747,11 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
}
[sectionLabs addRowWithTag:LABS_ENABLE_NEW_SESSION_MANAGER];
[sectionLabs addRowWithTag:LABS_ENABLE_NEW_CLIENT_INFO_FEATURE];
if (@available(iOS 15.0, *))
{
[sectionLabs addRowWithTag:LABS_ENABLE_WYSIWYG_COMPOSER];
}
[sectionLabs addRowWithTag:LABS_ENABLE_VOICE_BROADCAST];
sectionLabs.headerTitle = [VectorL10n settingsLabs];
if (sectionLabs.hasAnyRows)
{
@@ -856,9 +858,6 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
}];
[self userInterfaceThemeDidChange];
self.signOutAlertPresenter = [SignOutAlertPresenter new];
self.signOutAlertPresenter.delegate = self;
_tableViewSections = [TableViewSections new];
_tableViewSections.delegate = self;
[self updateSections];
@@ -925,8 +924,7 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
[super destroy];
}
_secureBackupSetupCoordinatorBridgePresenter = nil;
identityServerSettingsCoordinatorBridgePresenter = nil;
}
@@ -1490,6 +1488,8 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
// Update notification access
[self refreshSystemNotificationSettings];
[[MXKAccountManager sharedManager].activeAccounts.firstObject loadCurrentPusher:nil failure:nil];
}
- (void)refreshSystemNotificationSettings
@@ -1600,13 +1600,11 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
NSString *sdkVersionInfo = [NSString stringWithFormat:@"Matrix SDK %@", MatrixSDKVersion];
NSString *olmVersionInfo = [NSString stringWithFormat:@"OLM %@", [OLMKit versionString]];
[footerText appendFormat:@"%@\n", loggedUserInfo];
[footerText appendFormat:@"%@\n", homeserverInfo];
[footerText appendFormat:@"%@\n", appVersionInfo];
[footerText appendFormat:@"%@\n", sdkVersionInfo];
[footerText appendFormat:@"%@", olmVersionInfo];
[footerText appendFormat:@"%@", self.mainSession.crypto.version];
return [footerText copy];
}
@@ -2874,6 +2872,31 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
[labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleEnableNewClientInfoFeature:) forControlEvents:UIControlEventTouchUpInside];
cell = labelAndSwitchCell;
}
else if (row == LABS_ENABLE_WYSIWYG_COMPOSER)
{
MXKTableViewCellWithLabelAndSwitch *labelAndSwitchCell = [self getLabelAndSwitchCell:tableView forIndexPath:indexPath];
labelAndSwitchCell.mxkLabel.text = [VectorL10n settingsLabsEnableWysiwygComposer];
labelAndSwitchCell.mxkSwitch.on = RiotSettings.shared.enableWysiwygComposer;
labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor;
[labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleEnableWysiwygComposerFeature:) forControlEvents:UIControlEventTouchUpInside];
cell = labelAndSwitchCell;
}
else if (row == LABS_ENABLE_VOICE_BROADCAST)
{
MXKTableViewCellWithLabelAndSwitch *labelAndSwitchCell = [self getLabelAndSwitchCell:tableView forIndexPath:indexPath];
labelAndSwitchCell.mxkLabel.text = [VectorL10n settingsLabsEnableVoiceBroadcast];
labelAndSwitchCell.mxkSwitch.on = RiotSettings.shared.enableVoiceBroadcast;
labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor;
[labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleEnableVoiceBroadcastFeature:) forControlEvents:UIControlEventTouchUpInside];
cell = labelAndSwitchCell;
}
}
@@ -3221,6 +3244,7 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
WebViewViewController *webViewViewController = [[WebViewViewController alloc] initWithURL:BWIBuildSettings.shared.applicationCopyrightUrlString];
webViewViewController.title = [BWIL10n settingsCopyright];
[webViewViewController vc_setLargeTitleDisplayMode:UINavigationItemLargeTitleDisplayModeNever];
[self pushViewController:webViewViewController];
}
@@ -3229,6 +3253,7 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
WebViewViewController *webViewViewController = [[WebViewViewController alloc] initWithURL:BuildSettings.applicationTermsConditionsUrlString];
webViewViewController.title = [VectorL10n settingsTermConditions];
[webViewViewController vc_setLargeTitleDisplayMode:UINavigationItemLargeTitleDisplayModeNever];
[self pushViewController:webViewViewController];
}
@@ -3247,6 +3272,7 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
WebViewViewController *webViewViewController = [[WebViewViewController alloc] initWithURL:BWIBuildSettings.shared.applicationPrivacyPolicyUrlString];
webViewViewController.title = [VectorL10n settingsPrivacyPolicy];
[webViewViewController vc_setLargeTitleDisplayMode:UINavigationItemLargeTitleDisplayModeNever];
[self pushViewController:webViewViewController];
}
@@ -3257,6 +3283,7 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
WebViewViewController *webViewViewController = [[WebViewViewController alloc] initWithLocalHTMLFile:htmlFile];
webViewViewController.title = [VectorL10n settingsThirdPartyNotices];
[webViewViewController vc_setLargeTitleDisplayMode:UINavigationItemLargeTitleDisplayModeNever];
[self pushViewController:webViewViewController];
}
@@ -3368,13 +3395,11 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
{
self.signOutButton = (UIButton*)sender;
MXKeyBackup *keyBackup = self.mainSession.crypto.backup;
SignOutFlowPresenter *flowPresenter = [[SignOutFlowPresenter alloc] initWithSession:self.mainSession presentingViewController:self];
flowPresenter.delegate = self;
[self.signOutAlertPresenter presentFor:keyBackup.state
areThereKeysToBackup:keyBackup.hasKeysToBackup
from:self
sourceView:self.signOutButton
animated:YES];
[flowPresenter startWithSourceView:self.signOutButton];
self.signOutFlowPresenter = flowPresenter;
}
- (void)onRemove3PID:(NSIndexPath*)indexPath
@@ -3729,6 +3754,17 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
BOOL isEnabled = sender.isOn;
RiotSettings.shared.enableClientInformationFeature = isEnabled;
MXSDKOptions.sharedInstance.enableNewClientInformationFeature = isEnabled;
[self.mainSession updateClientInformation];
}
- (void)toggleEnableWysiwygComposerFeature:(UISwitch *)sender
{
RiotSettings.shared.enableWysiwygComposer = sender.isOn;
}
- (void)toggleEnableVoiceBroadcastFeature:(UISwitch *)sender
{
RiotSettings.shared.enableVoiceBroadcast = sender.isOn;
}
- (void)togglePinRoomsWithMissedNotif:(UISwitch *)sender
@@ -4622,123 +4658,25 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
self.notificationSettingsBridgePresenter = nil;
}
#pragma mark - SignOutFlowPresenterDelegate
#pragma mark - SecureBackupSetupCoordinatorBridgePresenter
- (void)showSecureBackupSetupFromSignOutFlow
- (void)signOutFlowPresenterDidStartLoading:(SignOutFlowPresenter *)presenter
{
if (self.canSetupSecureBackup)
{
[self setupSecureBackup2];
}
else
{
// Set up cross-signing first
[self setupCrossSigningWithTitle:[BWIL10n secureKeyBackupSetupIntroTitle]
message:[VectorL10n securitySettingsUserPasswordDescription]
success:^{
[self setupSecureBackup2];
} failure:^(NSError *error) {
}];
}
}
- (void)setupSecureBackup2
{
SecureBackupSetupCoordinatorBridgePresenter *secureBackupSetupCoordinatorBridgePresenter = [[SecureBackupSetupCoordinatorBridgePresenter alloc] initWithSession:self.mainSession allowOverwrite:YES];
secureBackupSetupCoordinatorBridgePresenter.delegate = self;
[secureBackupSetupCoordinatorBridgePresenter presentFrom:self animated:YES];
self.secureBackupSetupCoordinatorBridgePresenter = secureBackupSetupCoordinatorBridgePresenter;
}
- (BOOL)canSetupSecureBackup
{
return [self.mainSession vc_canSetupSecureBackup];
}
#pragma mark - SecureBackupSetupCoordinatorBridgePresenterDelegate
- (void)secureBackupSetupCoordinatorBridgePresenterDelegateDidComplete:(SecureBackupSetupCoordinatorBridgePresenter *)coordinatorBridgePresenter
{
[self.secureBackupSetupCoordinatorBridgePresenter dismissWithAnimated:YES completion:nil];
self.secureBackupSetupCoordinatorBridgePresenter = nil;
}
- (void)secureBackupSetupCoordinatorBridgePresenterDelegateDidCancel:(SecureBackupSetupCoordinatorBridgePresenter *)coordinatorBridgePresenter
{
[self.secureBackupSetupCoordinatorBridgePresenter dismissWithAnimated:YES completion:nil];
self.secureBackupSetupCoordinatorBridgePresenter = nil;
}
#pragma mark - SignOutAlertPresenterDelegate
- (void)signOutAlertPresenterDidTapBackupAction:(SignOutAlertPresenter * _Nonnull)presenter
{
[self showSecureBackupSetupFromSignOutFlow];
}
- (void)signOutAlertPresenterDidTapSignOutAction:(SignOutAlertPresenter * _Nonnull)presenter
{
// Prevent user to perform user interaction in settings when sign out
// TODO: Prevent user interaction in all application (navigation controller and split view controller included)
[self startActivityIndicator];
self.view.userInteractionEnabled = NO;
self.signOutButton.enabled = NO;
[self startActivityIndicator];
MXWeakify(self);
[[AppDelegate theDelegate] logoutWithConfirmation:NO completion:^(BOOL isLoggedOut) {
MXStrongifyAndReturnIfNil(self);
[self stopActivityIndicator];
self.view.userInteractionEnabled = YES;
self.signOutButton.enabled = YES;
}];
}
- (void)setupCrossSigningWithTitle:(NSString*)title
message:(NSString*)message
success:(void (^)(void))success
failure:(void (^)(NSError *error))failure
- (void)signOutFlowPresenterDidStopLoading:(SignOutFlowPresenter *)presenter
{
[self startActivityIndicator];
self.view.userInteractionEnabled = NO;
MXWeakify(self);
void (^animationCompletion)(void) = ^void () {
MXStrongifyAndReturnIfNil(self);
[self stopActivityIndicator];
self.view.userInteractionEnabled = YES;
[self.crossSigningSetupCoordinatorBridgePresenter dismissWithAnimated:YES completion:^{}];
self.crossSigningSetupCoordinatorBridgePresenter = nil;
};
CrossSigningSetupCoordinatorBridgePresenter *crossSigningSetupCoordinatorBridgePresenter = [[CrossSigningSetupCoordinatorBridgePresenter alloc] initWithSession:self.mainSession];
[crossSigningSetupCoordinatorBridgePresenter presentWith:title
message:message
from:self
animated:YES
success:^{
animationCompletion();
success();
} cancel:^{
animationCompletion();
failure(nil);
} failure:^(NSError * _Nonnull error) {
animationCompletion();
[[AppDelegate theDelegate] showErrorAsAlert:error];
failure(error);
}];
self.crossSigningSetupCoordinatorBridgePresenter = crossSigningSetupCoordinatorBridgePresenter;
[self stopActivityIndicator];
self.view.userInteractionEnabled = YES;
self.signOutButton.enabled = YES;
}
- (void)signOutFlowPresenter:(SignOutFlowPresenter *)presenter didFailWith:(NSError *)error
{
[[AppDelegate theDelegate] showErrorAsAlert:error];
}
#pragma mark - SingleImagePickerPresenterDelegate