From cc6e0e35cf6e662ffc3ad24e2510265caa5cf52a Mon Sep 17 00:00:00 2001 From: Dustin Mierau Date: Wed, 3 Jan 2024 23:55:39 -0800 Subject: 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. --- Hotline/Models/Server.swift | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Hotline/Models') 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 { -- cgit