a31bc807cb
SwiftUI app for the MeshMonitor REST API: setup screen with token storage in Keychain, welcome dashboard mirroring the Emacs welcome buffer, and channel/node/DM/unread lists with a shared chat view supporting both channel and direct messages.
21 lines
391 B
Swift
21 lines
391 B
Swift
import Foundation
|
|
|
|
enum ChatTarget: Hashable {
|
|
case channel(Int, name: String)
|
|
case dm(nodeId: String, name: String)
|
|
|
|
var title: String {
|
|
switch self {
|
|
case .channel(_, let name): return "#\(name)"
|
|
case .dm(_, let name): return name
|
|
}
|
|
}
|
|
|
|
var navigationKey: String {
|
|
switch self {
|
|
case .channel(let id, _): return "ch-\(id)"
|
|
case .dm(let id, _): return "dm-\(id)"
|
|
}
|
|
}
|
|
}
|