aboutsummaryrefslogtreecommitdiff
path: root/Hotline/Models
diff options
context:
space:
mode:
authorDustin Mierau <dustin@mierau.me>2024-07-26 16:26:04 -0700
committerDustin Mierau <dustin@mierau.me>2024-07-26 16:26:04 -0700
commitea7d65f60b6a984c15f55fe0a0a3145fbe3d7cbb (patch)
treeb64219f48ff45ab74ed5bc9e52ac1b3449095f45 /Hotline/Models
parent5a1aac0219febaaab953ce354bd75907b22daba5 (diff)
Display error messages from the server.
Diffstat (limited to 'Hotline/Models')
-rw-r--r--Hotline/Models/Hotline.swift7
1 files changed, 6 insertions, 1 deletions
diff --git a/Hotline/Models/Hotline.swift b/Hotline/Models/Hotline.swift
index e69116e..11781c7 100644
--- a/Hotline/Models/Hotline.swift
+++ b/Hotline/Models/Hotline.swift
@@ -140,6 +140,8 @@ class Hotline: Equatable, HotlineClientDelegate, HotlineFileDownloadClientDelega
var downloads: [HotlineTransferClient] = []
var unreadInstantMessages: [UInt16:UInt16] = [:]
var unreadPublicChat: Bool = false
+ var errorDisplayed: Bool = false
+ var errorMessage: String? = nil
@ObservationIgnored var bannerClient: HotlineFilePreviewClient?
#if os(macOS)
@@ -902,8 +904,11 @@ class Hotline: Equatable, HotlineClientDelegate, HotlineFileDownloadClientDelega
self.access = options
}
- func hotlineReceivedError(message: String) {
+ func hotlineReceivedErrorMessage(code: UInt32, message: String?) {
+ print("Hotline: received error message \(code)", message.debugDescription)
+ self.errorDisplayed = (message != nil) // Show error if there is a message to display.
+ self.errorMessage = message
}
// MARK: - Hotline Transfer Delegate