diff options
| author | Dustin Mierau <dustin@mierau.me> | 2025-11-13 20:53:39 -0800 |
|---|---|---|
| committer | Dustin Mierau <dustin@mierau.me> | 2025-11-13 20:53:39 -0800 |
| commit | 7ca2ece66a5d40964f5d640255d1b137433511a9 (patch) | |
| tree | a3352708a1a7afbe043433d401ce41793468a88b /Hotline/State | |
| parent | 8d4cdce6ec00db6b329a3b9ae71cfc37cd642e9b (diff) | |
UI to view user client info.
Diffstat (limited to 'Hotline/State')
| -rw-r--r-- | Hotline/State/HotlineState.swift | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Hotline/State/HotlineState.swift b/Hotline/State/HotlineState.swift index c632f91..318a468 100644 --- a/Hotline/State/HotlineState.swift +++ b/Hotline/State/HotlineState.swift @@ -797,6 +797,22 @@ class HotlineState: Equatable { let hotlineUsers = try await client.getUserList() self.users = hotlineUsers.map { User(hotlineUser: $0) } } + + func getClientInfoText(id userID: UInt16) async throws -> (username: String, info: String)? { + guard let client = self.client else { + throw HotlineClientError.notConnected + } + + do { + return try await client.getClientInfoText(for: userID) + } + catch let error as HotlineClientError { + self.errorMessage = error.userMessage + self.errorDisplayed = true + } + + return nil + } // MARK: - Files |