Commit 7036825d authored by Davide De Rosa's avatar Davide De Rosa
Browse files

Remove old OpenVPN/MACE conditional

parent e636f17d
......@@ -85,7 +85,7 @@ class Bootstrapper {
// as per App Store guidelines
let pref = Client.preferences.editable()
if !Flags.shared.enablesMACE(withVPNType: pref.vpnType) {
if !Flags.shared.enablesMACESetting {
pref.mace = false
}
if !Flags.shared.enablesRemotePortSetting {
......
......@@ -22,8 +22,6 @@
<true/>
<key>enablesMACESetting</key>
<false/>
<key>disablesMACEForOpenVPN</key>
<false/>
<key>enablesEncryptionSettings</key>
<true/>
<key>enablesRemotePortSetting</key>
......
......@@ -32,9 +32,7 @@ class Flags: NSObject {
@objc private(set) var enablesProtocolSelection = true
@objc private var enablesMACESetting = false
@objc private var disablesMACEForOpenVPN = false
@objc private(set) var enablesMACESetting = false
@objc private(set) var enablesEncryptionSettings = true
......@@ -63,11 +61,4 @@ class Flags: NSObject {
setValue(value, forKeyPath: key)
}
}
func enablesMACE(withVPNType vpnType: String) -> Bool {
guard enablesMACESetting else {
return false
}
return !(disablesMACEForOpenVPN && (vpnType == PIATunnelProfile.vpnType))
}
}
......@@ -316,7 +316,7 @@ class SettingsViewController: AutolayoutViewController {
// }
func commitChanges(_ completionHandler: @escaping () -> Void) {
if !enablesMACE() && !visibleSections.contains(.development) {
if !Flags.shared.enablesMACESetting && !visibleSections.contains(.development) {
pendingPreferences.mace = false
}
......@@ -436,10 +436,6 @@ class SettingsViewController: AutolayoutViewController {
// MARK: Helpers
private func enablesMACE() -> Bool {
return Flags.shared.enablesMACE(withVPNType: pendingPreferences.vpnType)
}
@objc private func redisplaySettings() {
var sections = SettingsViewController.allSections
if !Flags.shared.enablesProtocolSelection {
......@@ -450,7 +446,7 @@ class SettingsViewController: AutolayoutViewController {
sections.remove(at: sections.index(of: .encryption)!)
}
}
if enablesMACE() {
if Flags.shared.enablesMACESetting {
rowsBySection[.applicationSettings] = [
.automaticReconnection,
.darkTheme,
......@@ -585,7 +581,7 @@ extension SettingsViewController: UITableViewDataSource, UITableViewDelegate {
if !pendingPreferences.isPersistentConnection {
footer.append(L10n.Settings.ApplicationSettings.Persistent.Footer.disabled)
}
if enablesMACE() {
if Flags.shared.enablesMACESetting {
footer.append(L10n.Settings.ApplicationSettings.Mace.footer)
}
return footer.joined(separator: "\n\n")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment