merged element 1.8.10

This commit is contained in:
Arnfried Griesert
2022-05-03 12:48:01 +02:00
1235 changed files with 50869 additions and 23132 deletions
+60 -45
View File
@@ -200,7 +200,8 @@ typedef NS_ENUM(NSUInteger, LABS_ENABLE)
{
LABS_ENABLE_RINGING_FOR_GROUP_CALLS_INDEX = 0,
LABS_ENABLE_THREADS_INDEX,
LABS_ENABLE_MESSAGE_BUBBLES_INDEX
LABS_ENABLE_MESSAGE_BUBBLES_INDEX,
LABS_USE_ONLY_LATEST_USER_AVATAR_AND_NAME_INDEX
};
typedef NS_ENUM(NSUInteger, SECURITY)
@@ -308,7 +309,9 @@ TableViewSectionsDelegate>
@property (nonatomic) UNNotificationSettings *systemNotificationSettings;
@property (nonatomic, weak) DeactivateAccountViewController *deactivateAccountViewController;
@property (nonatomic, strong) NotificationSettingsCoordinatorBridgePresenter *notificationSettingsBridgePresenter;
@property (nonatomic, strong) SignOutAlertPresenter *signOutAlertPresenter;
@property (nonatomic, weak) UIButton *signOutButton;
@property (nonatomic, strong) SingleImagePickerPresenter *imagePickerPresenter;
@@ -335,7 +338,7 @@ TableViewSectionsDelegate>
@property (nonatomic) BOOL isPreparingIdentityService;
@property (nonatomic, strong) ServiceTermsModalCoordinatorBridgePresenter *serviceTermsModalCoordinatorBridgePresenter;
@property (nonatomic) AnalyticsScreenTimer *screenTimer;
@property (nonatomic) AnalyticsScreenTracker *screenTracker;
@end
@@ -372,7 +375,7 @@ TableViewSectionsDelegate>
shouldRemoveAvatarImage = false;
self.screenTimer = [[AnalyticsScreenTimer alloc] initWithScreen:AnalyticsScreenSettings];
self.screenTracker = [[AnalyticsScreenTracker alloc] initWithScreen:AnalyticsScreenSettings];
}
- (void)updateSections
@@ -692,6 +695,7 @@ TableViewSectionsDelegate>
[sectionLabs addRowWithTag:LABS_ENABLE_RINGING_FOR_GROUP_CALLS_INDEX];
[sectionLabs addRowWithTag:LABS_ENABLE_THREADS_INDEX];
[sectionLabs addRowWithTag:LABS_ENABLE_MESSAGE_BUBBLES_INDEX];
[sectionLabs addRowWithTag:LABS_USE_ONLY_LATEST_USER_AVATAR_AND_NAME_INDEX];
sectionLabs.headerTitle = [VectorL10n settingsLabs];
if (sectionLabs.hasAnyRows)
{
@@ -919,6 +923,8 @@ TableViewSectionsDelegate>
{
[super viewWillAppear:animated];
[self.screenTracker trackScreen];
// Refresh display
[self refreshSettings];
@@ -947,8 +953,6 @@ TableViewSectionsDelegate>
[self releasePushedViewController];
[self.settingsDiscoveryTableViewSection reload];
[self.screenTimer start];
}
- (void)viewWillDisappear:(BOOL)animated
@@ -992,12 +996,6 @@ TableViewSectionsDelegate>
}
}
- (void)viewDidDisappear:(BOOL)animated
{
[super viewDidDisappear:animated];
[self.screenTimer stop];
}
#pragma mark - Internal methods
- (void)pushViewController:(UIViewController*)viewController
@@ -1136,11 +1134,11 @@ TableViewSectionsDelegate>
{
MXWeakify(self);
[currentAlert dismissViewControllerAnimated:NO completion:nil];
UIAlertController *validationAlert = [UIAlertController alertControllerWithTitle:[MatrixKitL10n accountEmailValidationTitle]
UIAlertController *validationAlert = [UIAlertController alertControllerWithTitle:[VectorL10n accountEmailValidationTitle]
message:message
preferredStyle:UIAlertControllerStyleAlert];
[validationAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n cancel] style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
[validationAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n cancel] style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
MXStrongifyAndReturnIfNil(self);
self->currentAlert = nil;
[self stopActivityIndicator];
@@ -1149,7 +1147,7 @@ TableViewSectionsDelegate>
self.newEmailEditingEnabled = NO;
}]];
[validationAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n continue] style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
[validationAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n continue] style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
MXStrongifyAndReturnIfNil(self);
[self tryFinaliseAddEmailSession:threePidAddSession withAuthenticationParameters:authenticationParameters
threePidAddManager:threePidAddManager];
@@ -1234,7 +1232,7 @@ TableViewSectionsDelegate>
MXError *mxError = [[MXError alloc] initWithNSError:error];
if (mxError && [mxError.errcode isEqualToString:kMXErrCodeStringThreePIDAuthFailed])
{
[self showValidationEmailDialogWithMessage:[MatrixKitL10n accountEmailValidationError] for3PidAddSession:threePidAddSession threePidAddManager:threePidAddManager authenticationParameters:authParams];
[self showValidationEmailDialogWithMessage:[VectorL10n accountEmailValidationError] for3PidAddSession:threePidAddSession threePidAddManager:threePidAddManager authenticationParameters:authParams];
}
else
{
@@ -1253,11 +1251,11 @@ TableViewSectionsDelegate>
MXWeakify(self);
[currentAlert dismissViewControllerAnimated:NO completion:nil];
UIAlertController *validationAlert = [UIAlertController alertControllerWithTitle:[MatrixKitL10n accountMsisdnValidationTitle]
UIAlertController *validationAlert = [UIAlertController alertControllerWithTitle:[VectorL10n accountMsisdnValidationTitle]
message:message
preferredStyle:UIAlertControllerStyleAlert];
[validationAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n cancel] style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
[validationAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n cancel] style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
MXStrongifyAndReturnIfNil(self);
self->currentAlert = nil;
@@ -1274,7 +1272,7 @@ TableViewSectionsDelegate>
textField.keyboardType = UIKeyboardTypeDecimalPad;
}];
[validationAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n submit] style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
[validationAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n submit] style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
MXStrongifyAndReturnIfNil(self);
@@ -1384,7 +1382,7 @@ TableViewSectionsDelegate>
}
else
{
title = [MatrixKitL10n error];
title = [VectorL10n error];
}
}
@@ -1392,7 +1390,7 @@ TableViewSectionsDelegate>
UIAlertController *errorAlert = [UIAlertController alertControllerWithTitle:title message:msg preferredStyle:UIAlertControllerStyleAlert];
MXWeakify(self);
[errorAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n ok] style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
[errorAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n ok] style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
MXStrongifyAndReturnIfNil(self);
self->currentAlert = nil;
@@ -1582,9 +1580,9 @@ TableViewSectionsDelegate>
NSString *appVersionInfo = [NSString stringWithFormat:@"%@ %@ (%@)", appName, appVersion, buildVersion];
NSString *loggedUserInfo = [MatrixKitL10n settingsConfigUserId:account.mxCredentials.userId];
NSString *loggedUserInfo = [VectorL10n settingsConfigUserId:account.mxCredentials.userId];
NSString *homeserverInfo = [MatrixKitL10n settingsConfigHomeServer:account.mxCredentials.homeServer];
NSString *homeserverInfo = [VectorL10n settingsConfigHomeServer:account.mxCredentials.homeServer];
NSString *sdkVersionInfo = [NSString stringWithFormat:@"Matrix SDK %@", MatrixSDKVersion];
@@ -1988,7 +1986,7 @@ TableViewSectionsDelegate>
newEmailCell.mxkLabel.text = [VectorL10n settingsAddEmailAddress];
newEmailCell.mxkTextField.text = nil;
newEmailCell.mxkTextField.userInteractionEnabled = NO;
newEmailCell.accessoryView = [[UIImageView alloc] initWithImage:[[UIImage imageNamed:@"plus_icon"] vc_tintedImageUsingColor:ThemeService.shared.theme.textPrimaryColor]];
newEmailCell.accessoryView = [[UIImageView alloc] initWithImage:[AssetImages.plusIcon.image vc_tintedImageUsingColor:ThemeService.shared.theme.textPrimaryColor]];
}
else
{
@@ -2023,7 +2021,7 @@ TableViewSectionsDelegate>
newEmailTextField = newEmailCell.mxkTextField;
}
UIImage *accessoryViewImage = [[UIImage imageNamed:@"plus_icon"] vc_tintedImageUsingColor:ThemeService.shared.theme.tintColor];
UIImage *accessoryViewImage = [AssetImages.plusIcon.image vc_tintedImageUsingColor:ThemeService.shared.theme.tintColor];
newEmailCell.accessoryView = [[UIImageView alloc] initWithImage:accessoryViewImage];
}
@@ -2041,7 +2039,7 @@ TableViewSectionsDelegate>
newPhoneCell.mxkLabel.text = [VectorL10n settingsAddPhoneNumber];
newPhoneCell.mxkTextField.text = nil;
newPhoneCell.mxkTextField.userInteractionEnabled = NO;
newPhoneCell.accessoryView = [[UIImageView alloc] initWithImage:[[UIImage imageNamed:@"plus_icon"] vc_tintedImageUsingColor:ThemeService.shared.theme.textPrimaryColor]];
newPhoneCell.accessoryView = [[UIImageView alloc] initWithImage:[AssetImages.plusIcon.image vc_tintedImageUsingColor:ThemeService.shared.theme.textPrimaryColor]];
cell = newPhoneCell;
}
@@ -2103,7 +2101,7 @@ TableViewSectionsDelegate>
newPhoneNumberCell = newPhoneCell;
}
UIImage *accessoryViewImage = [[UIImage imageNamed:@"plus_icon"] vc_tintedImageUsingColor:ThemeService.shared.theme.tintColor];
UIImage *accessoryViewImage = [AssetImages.plusIcon.image vc_tintedImageUsingColor:ThemeService.shared.theme.tintColor];
newPhoneCell.accessoryView = [[UIImageView alloc] initWithImage:accessoryViewImage];
cell = newPhoneCell;
@@ -2737,6 +2735,18 @@ TableViewSectionsDelegate>
{
cell = [self buildMessageBubblesCellForTableView:tableView atIndexPath:indexPath];
}
else if (row == LABS_USE_ONLY_LATEST_USER_AVATAR_AND_NAME_INDEX)
{
MXKTableViewCellWithLabelAndSwitch *labelAndSwitchCell = [self getLabelAndSwitchCell:tableView forIndexPath:indexPath];
labelAndSwitchCell.mxkLabel.text = VectorL10n.settingsLabsUseOnlyLatestUserAvatarAndName;
labelAndSwitchCell.mxkSwitch.on = RiotSettings.shared.roomScreenUseOnlyLatestUserAvatarAndName;
labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor;
[labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleUseOnlyLatestUserAvatarAndName:) forControlEvents:UIControlEventTouchUpInside];
cell = labelAndSwitchCell;
}
}
else if (section == SECTION_TAG_FLAIR)
{
@@ -3038,7 +3048,7 @@ TableViewSectionsDelegate>
UIAlertController *unignorePrompt = [UIAlertController alertControllerWithTitle:[VectorL10n settingsUnignoreUser:ignoredUserId] message:nil preferredStyle:UIAlertControllerStyleAlert];
[unignorePrompt addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n yes]
[unignorePrompt addAction:[UIAlertAction actionWithTitle:[VectorL10n yes]
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
@@ -3069,7 +3079,7 @@ TableViewSectionsDelegate>
}]];
[unignorePrompt addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n no]
[unignorePrompt addAction:[UIAlertAction actionWithTitle:[VectorL10n no]
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
@@ -3291,7 +3301,7 @@ TableViewSectionsDelegate>
// Remove ?
UIAlertController *removePrompt = [UIAlertController alertControllerWithTitle:[VectorL10n settingsRemovePromptTitle] message:promptMsg preferredStyle:UIAlertControllerStyleAlert];
[removePrompt addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n cancel]
[removePrompt addAction:[UIAlertAction actionWithTitle:[VectorL10n cancel]
style:UIAlertActionStyleCancel
handler:^(UIAlertAction * action) {
@@ -3380,7 +3390,7 @@ TableViewSectionsDelegate>
UIAlertController *showSettingsPrompt = [UIAlertController alertControllerWithTitle:title message:message preferredStyle:UIAlertControllerStyleAlert];
[showSettingsPrompt addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n cancel]
[showSettingsPrompt addAction:[UIAlertAction actionWithTitle:[VectorL10n cancel]
style:UIAlertActionStyleCancel
handler:^(UIAlertAction * action) {
@@ -3392,7 +3402,7 @@ TableViewSectionsDelegate>
}]];
UIAlertAction *settingsAction = [UIAlertAction actionWithTitle:[MatrixKitL10n settings]
UIAlertAction *settingsAction = [UIAlertAction actionWithTitle:[VectorL10n settings]
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
if (weakSelf)
@@ -3605,6 +3615,11 @@ TableViewSectionsDelegate>
}
}
- (void)toggleUseOnlyLatestUserAvatarAndName:(UISwitch *)sender
{
RiotSettings.shared.roomScreenUseOnlyLatestUserAvatarAndName = sender.isOn;
}
- (void)markAllAsRead:(id)sender
{
// Feedback: disable button and run activity indicator
@@ -3816,7 +3831,7 @@ TableViewSectionsDelegate>
UIAlertController *errorAlert = [UIAlertController alertControllerWithTitle:title message:msg preferredStyle:UIAlertControllerStyleAlert];
[errorAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n cancel]
[errorAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n cancel]
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
@@ -3840,7 +3855,7 @@ TableViewSectionsDelegate>
}]];
[errorAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n retry]
[errorAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n retry]
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
@@ -3879,11 +3894,11 @@ TableViewSectionsDelegate>
[currentAlert dismissViewControllerAnimated:NO completion:nil];
UIAlertController *errorAlert = [UIAlertController alertControllerWithTitle:[MatrixKitL10n accountErrorEmailWrongTitle]
message:[MatrixKitL10n accountErrorEmailWrongDescription]
UIAlertController *errorAlert = [UIAlertController alertControllerWithTitle:[VectorL10n accountErrorEmailWrongTitle]
message:[VectorL10n accountErrorEmailWrongDescription]
preferredStyle:UIAlertControllerStyleAlert];
[errorAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n ok]
[errorAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n ok]
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
@@ -3914,7 +3929,7 @@ TableViewSectionsDelegate>
__block MX3PidAddSession *thirdPidAddSession;
thirdPidAddSession = [session.threePidAddManager startAddEmailSessionWithEmail:self->newEmailTextField.text nextLink:nil success:^{
[self showValidationEmailDialogWithMessage:[MatrixKitL10n accountEmailValidationMessage]
[self showValidationEmailDialogWithMessage:[VectorL10n accountEmailValidationMessage]
for3PidAddSession:thirdPidAddSession
threePidAddManager:session.threePidAddManager
authenticationParameters:authParams];
@@ -3990,11 +4005,11 @@ TableViewSectionsDelegate>
[currentAlert dismissViewControllerAnimated:NO completion:nil];
__weak typeof(self) weakSelf = self;
UIAlertController *errorAlert = [UIAlertController alertControllerWithTitle:[MatrixKitL10n accountErrorMsisdnWrongTitle]
message:[MatrixKitL10n accountErrorMsisdnWrongDescription]
UIAlertController *errorAlert = [UIAlertController alertControllerWithTitle:[VectorL10n accountErrorMsisdnWrongTitle]
message:[VectorL10n accountErrorMsisdnWrongDescription]
preferredStyle:UIAlertControllerStyleAlert];
[errorAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n ok]
[errorAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n ok]
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
@@ -4035,7 +4050,7 @@ TableViewSectionsDelegate>
__block MX3PidAddSession *new3Pid;
new3Pid = [session.threePidAddManager startAddPhoneNumberSessionWithPhoneNumber:msisdn countryCode:nil success:^{
[self showValidationMsisdnDialogWithMessage:[MatrixKitL10n accountMsisdnValidationMessage] for3PidAddSession:new3Pid threePidAddManager:session.threePidAddManager authenticationParameters:authParams];
[self showValidationMsisdnDialogWithMessage:[VectorL10n accountMsisdnValidationMessage] for3PidAddSession:new3Pid threePidAddManager:session.threePidAddManager authenticationParameters:authParams];
} failure:^(NSError *error) {
@@ -4220,7 +4235,7 @@ TableViewSectionsDelegate>
[themePicker addAction:blackAction];
// Cancel button
[themePicker addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n cancel]
[themePicker addAction:[UIAlertAction actionWithTitle:[VectorL10n cancel]
style:UIAlertActionStyleCancel
handler:nil]];
@@ -4388,7 +4403,7 @@ TableViewSectionsDelegate>
UIAlertController *successAlert = [UIAlertController alertControllerWithTitle:nil message:[VectorL10n settingsPasswordUpdated] preferredStyle:UIAlertControllerStyleAlert];
[successAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n ok]
[successAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n ok]
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
@@ -4437,7 +4452,7 @@ TableViewSectionsDelegate>
UIAlertController *errorAlert = [UIAlertController alertControllerWithTitle:nil message:[VectorL10n settingsFailToUpdatePassword] preferredStyle:UIAlertControllerStyleAlert];
[errorAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n ok]
[errorAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n ok]
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
@@ -4997,7 +5012,7 @@ TableViewSectionsDelegate>
message:nil
preferredStyle:UIAlertControllerStyleAlert];
[alertController addAction:[UIAlertAction actionWithTitle:MatrixKitL10n.ok
[alertController addAction:[UIAlertAction actionWithTitle:VectorL10n.ok
style:UIAlertActionStyleDefault
handler:nil]];