|
@@ -6,7 +6,6 @@ class AccountSetupController: UITableViewController, ProgressAlertHandler {
|
|
private var dcContext: DcContext
|
|
private var dcContext: DcContext
|
|
private let dcAccounts: DcAccounts
|
|
private let dcAccounts: DcAccounts
|
|
private var skipOauth = false
|
|
private var skipOauth = false
|
|
- private var accountEncryption: Bool?
|
|
|
|
private var backupProgressObserver: NSObjectProtocol?
|
|
private var backupProgressObserver: NSObjectProtocol?
|
|
var progressObserver: NSObjectProtocol?
|
|
var progressObserver: NSObjectProtocol?
|
|
var onProgressSuccess: VoidFunction? // not needed here
|
|
var onProgressSuccess: VoidFunction? // not needed here
|
|
@@ -29,7 +28,6 @@ class AccountSetupController: UITableViewController, ProgressAlertHandler {
|
|
private let tagCertCheckCell = 12
|
|
private let tagCertCheckCell = 12
|
|
private let tagRestoreCell = 14
|
|
private let tagRestoreCell = 14
|
|
private let tagViewLogCell = 15
|
|
private let tagViewLogCell = 15
|
|
- private let tagAccountEncryptionCell = 16
|
|
|
|
|
|
|
|
private let tagTextFieldEmail = 100
|
|
private let tagTextFieldEmail = 100
|
|
private let tagTextFieldPassword = 200
|
|
private let tagTextFieldPassword = 200
|
|
@@ -53,7 +51,6 @@ class AccountSetupController: UITableViewController, ProgressAlertHandler {
|
|
private lazy var restoreCells: [UITableViewCell] = [restoreCell]
|
|
private lazy var restoreCells: [UITableViewCell] = [restoreCell]
|
|
private lazy var advancedSectionCells: [UITableViewCell] = [
|
|
private lazy var advancedSectionCells: [UITableViewCell] = [
|
|
advancedShowCell,
|
|
advancedShowCell,
|
|
- accountEncryptionCell,
|
|
|
|
imapSecurityCell,
|
|
imapSecurityCell,
|
|
imapUserCell,
|
|
imapUserCell,
|
|
imapServerCell,
|
|
imapServerCell,
|
|
@@ -123,17 +120,6 @@ class AccountSetupController: UITableViewController, ProgressAlertHandler {
|
|
return cell
|
|
return cell
|
|
}()
|
|
}()
|
|
|
|
|
|
- lazy var accountEncryptionCell: SwitchCell = {
|
|
|
|
- let isEditable = !dcContext.isConfigured() && !dcContext.isOpen()
|
|
|
|
- let cell = SwitchCell(textLabel: String.localized("account_encryption"), on: false, action: { [weak self] cell in
|
|
|
|
- self?.accountEncryption = cell.isOn
|
|
|
|
- })
|
|
|
|
- cell.isHidden = !isEditable
|
|
|
|
- cell.isUserInteractionEnabled = isEditable
|
|
|
|
- cell.tag = tagAccountEncryptionCell
|
|
|
|
- return cell
|
|
|
|
- }()
|
|
|
|
-
|
|
|
|
lazy var imapServerCell: TextFieldCell = {
|
|
lazy var imapServerCell: TextFieldCell = {
|
|
let cell = TextFieldCell(
|
|
let cell = TextFieldCell(
|
|
descriptionID: "login_imap_server",
|
|
descriptionID: "login_imap_server",
|
|
@@ -537,17 +523,6 @@ class AccountSetupController: UITableViewController, ProgressAlertHandler {
|
|
}
|
|
}
|
|
|
|
|
|
let password = passwordCell.getText() ?? "" // empty passwords are ok -> for oauth there is no password needed
|
|
let password = passwordCell.getText() ?? "" // empty passwords are ok -> for oauth there is no password needed
|
|
- var dbPassphrase: String?
|
|
|
|
- if !dcContext.isOpen() {
|
|
|
|
- if let encryptionEnabled = accountEncryption, encryptionEnabled {
|
|
|
|
- do {
|
|
|
|
- dbPassphrase = try KeychainManager.getDBSecret()
|
|
|
|
- } catch {
|
|
|
|
- logger.error("failed to obtain db secret: \(error)")
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- dcContext.open(passphrase: dbPassphrase)
|
|
|
|
- }
|
|
|
|
|
|
|
|
login(emailAddress: emailAddress, password: password)
|
|
login(emailAddress: emailAddress, password: password)
|
|
}
|
|
}
|
|
@@ -791,10 +766,6 @@ class AccountSetupController: UITableViewController, ProgressAlertHandler {
|
|
imapSecurityCell.detailTextLabel?.text = SecurityConverter.getSocketName(value: Int32(dcContext.getConfigInt("mail_security")))
|
|
imapSecurityCell.detailTextLabel?.text = SecurityConverter.getSocketName(value: Int32(dcContext.getConfigInt("mail_security")))
|
|
smtpSecurityCell.detailTextLabel?.text = SecurityConverter.getSocketName(value: Int32(dcContext.getConfigInt("send_security")))
|
|
smtpSecurityCell.detailTextLabel?.text = SecurityConverter.getSocketName(value: Int32(dcContext.getConfigInt("send_security")))
|
|
certCheckCell.detailTextLabel?.text = CertificateCheckController.ValueConverter.convertHexToString(value: dcContext.certificateChecks)
|
|
certCheckCell.detailTextLabel?.text = CertificateCheckController.ValueConverter.convertHexToString(value: dcContext.certificateChecks)
|
|
- if dcContext.isConfigured() || dcContext.isOpen() {
|
|
|
|
- // remove account selection option
|
|
|
|
- advancedSectionCells.remove(at: 1)
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
|
|
|
|
private func resignFirstResponderOnAllCells() {
|
|
private func resignFirstResponderOnAllCells() {
|