diff options
| author | Dustin Mierau <dustin@mierau.me> | 2024-01-03 23:55:39 -0800 |
|---|---|---|
| committer | Dustin Mierau <dustin@mierau.me> | 2024-01-03 23:55:39 -0800 |
| commit | cc6e0e35cf6e662ffc3ad24e2510265caa5cf52a (patch) | |
| tree | 908b99f7995edf9dc911209be656fb731c47c5ad /Hotline/Models | |
| parent | 2286040715ff8c08c4114c60e81f087f92d53800 (diff) | |
Server windows restore with app session now. Implemented new login view so you can connect to specific IP servers no listed by tracker, login/pass supported (I think?), and a nicer connect progress display.
Diffstat (limited to 'Hotline/Models')
| -rw-r--r-- | Hotline/Models/Server.swift | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Hotline/Models/Server.swift b/Hotline/Models/Server.swift index da4f01f..62c6867 100644 --- a/Hotline/Models/Server.swift +++ b/Hotline/Models/Server.swift @@ -14,6 +14,13 @@ struct Server: Codable { self.port = port self.users = users } + + static func parseServerAddressAndPort(_ address: String) -> (String, Int) { + let url = URL(string: "hotline://\(address)") + let port = url?.port ?? HotlinePorts.DefaultServerPort + let host = url?.host(percentEncoded: false) ?? address + return (host, port) + } } extension Server: Identifiable { |