Commit a099386b authored by Jose Blaya's avatar Jose Blaya

- Remove hotspot helper command handlers

- Refactor
parent 0659cdb1
......@@ -77,34 +77,6 @@ class PIAHotspotHelper {
log.info("present PIA message for unprotected networks")
}
response.deliver()
} else if cmd.commandType == NEHotspotHelperCommandType.evaluate {
if let network = cmd.network {
log.info("HotspotHelper Evaluating: "+network.ssid)
network.setConfidence(NEHotspotHelperConfidence.high)
let response = cmd.createResponse(NEHotspotHelperResult.success)
response.setNetwork(network)
response.deliver()
}
} else if cmd.commandType == NEHotspotHelperCommandType.authenticate{
if let network = cmd.network {
log.info("HotspotHelper: Authenticating the network: "+network.ssid)
network.setConfidence(.high)
let response = cmd.createResponse(NEHotspotHelperResult.success)
response.setNetwork(network)
response.deliver()
}
} else if cmd.commandType == NEHotspotHelperCommandType.presentUI{
if let network = cmd.network {
log.info("HotspotHelper: presentUI for network: "+network.ssid)
network.setConfidence(.high)
let response = cmd.createResponse(NEHotspotHelperResult.success)
response.setNetwork(network)
response.deliver()
}
} else if cmd.commandType == NEHotspotHelperCommandType.maintain{
if let network = cmd.network {
log.info("HotspotHelper:maintain network: "+network.ssid)
}
}
......
......@@ -25,6 +25,8 @@ class TrustedNetworksViewController: AutolayoutViewController {
var hasUpdatedPreferences = false
var persistentConnectionValue = false
private let numberOfVisibleSections = 4
private enum Sections: Int, EnumsBuilder {
case rules = 0
......@@ -187,7 +189,8 @@ extension TrustedNetworksViewController: UITableViewDelegate, UITableViewDataSou
func numberOfSections(in tableView: UITableView) -> Int {
if Client.preferences.nmtRulesEnabled {
return Client.preferences.useWiFiProtection ? Sections.countCases() : 4
return Client.preferences.useWiFiProtection ?
Sections.countCases() : numberOfVisibleSections
} else {
return 1
}
......
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