aboutsummaryrefslogtreecommitdiff
path: root/Hotline/State
diff options
context:
space:
mode:
authorDustin Mierau <dustin@mierau.me>2025-11-12 21:45:13 -0800
committerDustin Mierau <dustin@mierau.me>2025-11-12 21:45:13 -0800
commit3795039436f741ec23f65e7cd0639023bac1f1ca (patch)
tree1cbaf5c1b37583d9af7f84a075b97d131f93054c /Hotline/State
parent79a37fa509576c94b96ff896550426d8ebfdec67 (diff)
More work on account management. Add Broadcast UI.
Diffstat (limited to 'Hotline/State')
-rw-r--r--Hotline/State/HotlineState.swift10
-rw-r--r--Hotline/State/ServerState.swift1
2 files changed, 11 insertions, 0 deletions
diff --git a/Hotline/State/HotlineState.swift b/Hotline/State/HotlineState.swift
index 5d6471c..627b6a0 100644
--- a/Hotline/State/HotlineState.swift
+++ b/Hotline/State/HotlineState.swift
@@ -184,6 +184,7 @@ class HotlineState: Equatable {
var users: [User] = []
// Chat
+ var broadcastMessage: String = ""
var chat: [ChatMessage] = []
var chatInput: String = ""
var unreadPublicChat: Bool = false
@@ -613,6 +614,15 @@ class HotlineState: Equatable {
}
// MARK: - Chat
+
+ @MainActor
+ func sendBroadcast(_ message: String) async throws {
+ guard let client = self.client else {
+ throw HotlineClientError.notConnected
+ }
+
+ try await client.sendBroadcast(message)
+ }
@MainActor
func sendChat(_ text: String, announce: Bool = false) async throws {
diff --git a/Hotline/State/ServerState.swift b/Hotline/State/ServerState.swift
index 8f8d3bf..3fe10f9 100644
--- a/Hotline/State/ServerState.swift
+++ b/Hotline/State/ServerState.swift
@@ -6,6 +6,7 @@ class ServerState: Equatable {
var selection: ServerNavigationType
var serverName: String? = nil
var accountsShown: Bool = false
+ var broadcastShown: Bool = false
// var serverBanner: NSImage? = nil
// var bannerBackgroundColor: Color? = nil