Files
andros a31bc807cb Initial iOS port of meshmonitor-chat.el
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.
2026-04-14 15:30:21 +02:00

27 lines
465 B
Swift

import Foundation
struct Channel: Identifiable, Hashable, Decodable {
let id: Int
let name: String?
let role: Int?
var displayName: String {
if let name, !name.isEmpty { return name }
return "Channel \(id)"
}
var roleName: String {
switch role ?? 0 {
case 1: return "Primary"
case 2: return "Secondary"
default: return "Disabled"
}
}
var isUsable: Bool { (role ?? 0) > 0 }
}
struct ChannelListResponse: Decodable {
let data: [Channel]
}