pub enum ServerMsg {
Challenge {
nonce_b64: String,
},
Ready {
fingerprint: String,
},
Message {
room: String,
id: String,
payload_b64: String,
mailbox_id: Option<i64>,
seq: Option<i64>,
},
Sent {
id: String,
delivered: usize,
queued: usize,
},
ConnectToken {
token: String,
ttl_secs: u64,
},
ConnectTokenResolved {
token: String,
fingerprint: Option<String>,
pubkey_b64: Option<String>,
},
Pong,
Error {
message: String,
},
}Expand description
Relay → client. The relay serializes these; the client deserializes them.
Variants§
Challenge
huddle 1.1.4: sent immediately on connect. The client signs the nonce to prove control of its identity key before it can do anything.
Ready
Sent after a successful Hello. Carries the authenticated fingerprint
(the client already knows its own identity, so it ignores the field).
Message
A room message delivered live or from the offline mailbox. huddle 2.0:
mailbox_id is Some(row_id) when the message came from the relay’s
on-disk queue AND the recipient advertised ACK support in its Hello;
None for live fan-out and pre-2.0 clients. skip_serializing_if keeps
the field off the wire for live/legacy messages so old clients see
exactly the bytes they expect.
Fields
seq: Option<i64>huddle 2.0.8 (WS2 foundations #5): the relay-assigned per-room
monotonic sequence number for total-ordered delivery — the
foundation MLS commit ordering needs. None for non-room deliveries
(SendDirect), offline-mailbox replays in this first slice, and
pre-2.0.8 relays; additive, so older clients ignore it.
Sent
ConnectToken
huddle 1.2.1: a freshly minted connect code + its lifetime (seconds).
ConnectTokenResolved
huddle 1.2.1: result of redeeming a connect code. fingerprint /
pubkey_b64 are None when the code is unknown or expired. The relay
echoes the token; the client ignores it.