pub enum ClientMsg {
Hello {
fingerprint: String,
pubkey_b64: String,
signature_b64: String,
rooms: Vec<String>,
acks: bool,
},
Subscribe {
room: String,
},
Unsubscribe {
room: String,
},
Publish {
room: String,
id: String,
payload_b64: String,
},
SendDirect {
to: String,
room: String,
id: String,
payload_b64: String,
},
CreateConnectToken,
RedeemConnectToken {
token: String,
},
Fetch,
Ack {
mailbox_id: i64,
},
Ping,
}Expand description
Client → relay. The client serializes these; the relay deserializes them,
tolerating absent optional fields from older clients via serde(default).
Variants§
Hello
Announce identity and (re)assert room memberships, then drain the
mailbox. Must be the first message. huddle 1.1.4: it authenticates —
pubkey_b64 is the client’s Ed25519 pubkey and signature_b64 is a
signature over RELAY_AUTH_DOMAIN || nonce for the nonce the relay sent
in the opening Challenge. The relay verifies both before registering.
Fields
acks: boolhuddle 2.0: capability bit — the client implements at-least-once
mailbox ACKs (it answers each queued Message with ClientMsg::Ack
carrying the row’s mailbox_id). When true the relay tags each
mailbox delivery with its row id and keeps the row until the matching
Ack arrives; when false (pre-2.0 clients — the serde default) the
relay falls back to classical delete-on-deliver.
Subscribe
Unsubscribe
Publish
Send an opaque payload to every other member of room.
SendDirect
huddle 1.2: deliver an opaque payload to a SPECIFIC recipient
fingerprint, independent of room membership — how 1:1 DMs and friend
requests route reliably. room is an opaque tag the recipient’s client
uses to file the message; the relay never interprets it.
CreateConnectToken
huddle 1.2.1: mint a short-lived connect code bound to this
authenticated identity. The relay replies with ConnectToken.
RedeemConnectToken
huddle 1.2.1: resolve a connect code to its owner’s fingerprint+pubkey.
The relay replies with ConnectTokenResolved (fingerprint = None when
unknown/expired).
Fetch
Re-drain the mailbox on demand.
Ack
huddle 2.0: acknowledge durable receipt of a relay-delivered mailbox message. The relay deletes the row only after this ACK (at-least-once delivery). Scoped to the authenticated fingerprint.