From fe669bb3e0f46ed75244c8c22e7f6e65a2796b4c Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Thu, 4 Apr 2019 13:23:20 +0200 Subject: [PATCH] Migrate to Configuration optionals - cipher - digest - compressionFraming --- .../Scenes/ConfigurationViewController.swift | 10 +++++----- Passepartout-iOS/Scenes/ServiceViewController.swift | 6 +++--- .../Sources/Model/SessionProxy+Communication.swift | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Passepartout-iOS/Scenes/ConfigurationViewController.swift b/Passepartout-iOS/Scenes/ConfigurationViewController.swift index 3822fc93..5bb17f0d 100644 --- a/Passepartout-iOS/Scenes/ConfigurationViewController.swift +++ b/Passepartout-iOS/Scenes/ConfigurationViewController.swift @@ -241,12 +241,12 @@ extension ConfigurationViewController: UITableViewDataSource, UITableViewDelegat switch row { case .cipher: cell.leftText = L10n.Configuration.Cells.Cipher.caption - cell.rightText = configuration.cipher.description + cell.rightText = configuration.fallbackCipher.description case .digest: cell.leftText = L10n.Configuration.Cells.Digest.caption - if !configuration.cipher.embedsDigest { - cell.rightText = configuration.digest.description + if !configuration.fallbackCipher.embedsDigest { + cell.rightText = configuration.fallbackDigest.description } else { cell.rightText = L10n.Configuration.Cells.Digest.Value.embedded cell.accessoryType = .none @@ -287,7 +287,7 @@ extension ConfigurationViewController: UITableViewDataSource, UITableViewDelegat case .compressionFraming: cell.leftText = L10n.Configuration.Cells.CompressionFraming.caption - cell.rightText = configuration.compressionFraming.cellDescription + cell.rightText = configuration.fallbackCompressionFraming.cellDescription cell.accessoryType = .none cell.isTappable = false @@ -360,7 +360,7 @@ extension ConfigurationViewController: UITableViewDataSource, UITableViewDelegat navigationController?.pushViewController(vc, animated: true) case .digest: - guard !configuration.cipher.embedsDigest else { + guard !configuration.fallbackCipher.embedsDigest else { return } diff --git a/Passepartout-iOS/Scenes/ServiceViewController.swift b/Passepartout-iOS/Scenes/ServiceViewController.swift index 2baba8b7..3838ac84 100644 --- a/Passepartout-iOS/Scenes/ServiceViewController.swift +++ b/Passepartout-iOS/Scenes/ServiceViewController.swift @@ -701,10 +701,10 @@ extension ServiceViewController: UITableViewDataSource, UITableViewDelegate, Tog let cell = Cells.setting.dequeue(from: tableView, for: indexPath) cell.leftText = L10n.Service.Cells.Host.Parameters.caption let V = L10n.Service.Cells.Host.Parameters.Value.self - if !parameters.sessionConfiguration.cipher.embedsDigest { - cell.rightText = V.cipherDigest(parameters.sessionConfiguration.cipher.genericName, parameters.sessionConfiguration.digest.genericName) + if !parameters.sessionConfiguration.fallbackCipher.embedsDigest { + cell.rightText = V.cipherDigest(parameters.sessionConfiguration.fallbackCipher.genericName, parameters.sessionConfiguration.fallbackDigest.genericName) } else { - cell.rightText = V.cipher(parameters.sessionConfiguration.cipher.genericName) + cell.rightText = V.cipher(parameters.sessionConfiguration.fallbackCipher.genericName) } return cell diff --git a/Passepartout/Sources/Model/SessionProxy+Communication.swift b/Passepartout/Sources/Model/SessionProxy+Communication.swift index 2767a56e..ba8f0001 100644 --- a/Passepartout/Sources/Model/SessionProxy+Communication.swift +++ b/Passepartout/Sources/Model/SessionProxy+Communication.swift @@ -36,7 +36,7 @@ public extension SessionProxy.ConfigurationBuilder { func canCommunicate(with other: SessionProxy.Configuration) -> Bool { return (cipher == other.cipher) && - ((digest == other.digest) || cipher.embedsDigest) && + ((digest == other.digest) || fallbackCipher.embedsDigest) && (compressionFraming == other.compressionFraming) } }