diff options
Diffstat (limited to 'Hotline/Models/Server.swift')
| -rw-r--r-- | Hotline/Models/Server.swift | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Hotline/Models/Server.swift b/Hotline/Models/Server.swift index bcac81f..f0a9524 100644 --- a/Hotline/Models/Server.swift +++ b/Hotline/Models/Server.swift @@ -10,6 +10,8 @@ struct Server: Codable { var login: String var password: String + var autoconnect: Bool + var displayAddress: String { if self.port == HotlinePorts.DefaultServerPort { return self.address @@ -24,7 +26,7 @@ struct Server: Codable { } } - init(name: String?, description: String?, address: String, port: Int = HotlinePorts.DefaultServerPort, users: Int = 0, login: String? = nil, password: String? = nil) { + init(name: String?, description: String?, address: String, port: Int = HotlinePorts.DefaultServerPort, users: Int = 0, login: String? = nil, password: String? = nil, autoconnect: Bool? = nil) { self.name = name self.description = description self.address = address.lowercased() @@ -53,6 +55,7 @@ struct Server: Codable { self.login = url.user(percentEncoded: false) ?? "" self.password = url.password(percentEncoded: false) ?? "" + self.autoconnect = false } static func parseServerAddressAndPort(_ address: String) -> (String, Int) { |