mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-26 19:34:25 +02:00
MESSENGER-2762 Initial Merge
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
Copyright 2020 New Vector Ltd
|
||||
Copyright (c) 2021 BWI GmbH
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@@ -378,7 +379,6 @@ enum {
|
||||
MXDeviceInfo *deviceInfo = [self.mainSession.crypto deviceWithDeviceId:deviceId ofUser:self.mainSession.myUser.userId];
|
||||
|
||||
cell.textLabel.numberOfLines = 0;
|
||||
[cell vc_setAccessoryDisclosureIndicatorWithCurrentTheme];
|
||||
|
||||
if (deviceInfo.trustLevel.isVerified)
|
||||
{
|
||||
@@ -390,6 +390,12 @@ enum {
|
||||
cell.textLabel.text = [VectorL10n manageSessionNotTrusted];
|
||||
cell.imageView.image = [UIImage imageNamed:@"encryption_warning"];
|
||||
}
|
||||
|
||||
if (BuildSettings.bwiDisableSecuritySettingsUntrustedDevices && !deviceInfo.trustLevel.isVerified) {
|
||||
cell.accessoryType = UITableViewCellAccessoryNone;
|
||||
} else {
|
||||
[cell vc_setAccessoryDisclosureIndicatorWithCurrentTheme];
|
||||
}
|
||||
|
||||
return cell;
|
||||
}
|
||||
@@ -550,6 +556,21 @@ enum {
|
||||
return 24;
|
||||
}
|
||||
|
||||
- (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
if (BuildSettings.bwiDisableSecuritySettingsUntrustedDevices) {
|
||||
if (indexPath.section == SECTION_SESSION_INFO && indexPath.row == SESSION_INFO_TRUST) {
|
||||
NSString *deviceId = device.deviceId;
|
||||
MXDeviceInfo *deviceInfo = [self.mainSession.crypto deviceWithDeviceId:deviceId ofUser:self.mainSession.myUser.userId];
|
||||
|
||||
// unverified devices should not be selectable
|
||||
if (!deviceInfo.trustLevel.isVerified) {
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
}
|
||||
return indexPath;
|
||||
}
|
||||
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
if (self.tableView == tableView)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
Copyright 2020 New Vector Ltd
|
||||
Copyright (c) 2021 BWI GmbH
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@@ -297,9 +298,11 @@ TableViewSectionsDelegate>
|
||||
- (void)updateSections
|
||||
{
|
||||
NSMutableArray<Section*> *sections = [NSMutableArray array];
|
||||
|
||||
|
||||
BOOL isSecuredBackupRequired = [self.mainSession.homeserverWellknown backupRequired];
|
||||
|
||||
// Pin code section
|
||||
|
||||
|
||||
Section *pinCodeSection = [Section sectionWithTag:SECTION_PIN_CODE];
|
||||
|
||||
// Header and footer
|
||||
@@ -823,15 +826,14 @@ TableViewSectionsDelegate>
|
||||
|
||||
[alertController addAction:[UIAlertAction actionWithTitle:@"Reset"
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction * action)
|
||||
{
|
||||
// Setup and reset are the same thing
|
||||
[self setupCrossSigning:nil];
|
||||
}]];
|
||||
handler:^(UIAlertAction * action) {
|
||||
// Setup and reset are the same thing
|
||||
[self setupCrossSigning:nil];
|
||||
}]];
|
||||
|
||||
[alertController addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n cancel]
|
||||
style:UIAlertActionStyleCancel
|
||||
handler:nil]];
|
||||
style:UIAlertActionStyleCancel
|
||||
handler:nil]];
|
||||
|
||||
[self presentViewController:alertController animated:YES completion:nil];
|
||||
currentAlert = alertController;
|
||||
@@ -1417,14 +1419,14 @@ TableViewSectionsDelegate>
|
||||
preferredStyle:UIAlertControllerStyleAlert];
|
||||
|
||||
[alertController addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n ok]
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction * action) {
|
||||
[self presentCompleteSecurity];
|
||||
}]];
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction * action) {
|
||||
[self presentCompleteSecurity];
|
||||
}]];
|
||||
|
||||
[alertController addAction:[UIAlertAction actionWithTitle:[VectorL10n later]
|
||||
style:UIAlertActionStyleCancel
|
||||
handler:nil]];
|
||||
style:UIAlertActionStyleCancel
|
||||
handler:nil]];
|
||||
|
||||
[self presentViewController:alertController animated:YES completion:nil];
|
||||
currentAlert = alertController;
|
||||
|
||||
Reference in New Issue
Block a user