Expand description
Sending and fetching Community channel messages over a Transport.
publish_message seals a message (envelope) and publishes the outer event to
the Community’s relays. fetch_channel_messages queries the channel’s current
epoch pseudonym, then decrypts + verifies each event, silently dropping any that
fail (wrong key, splice, bad signature) — a non-member, or a spliced event, never
surfaces. Both are transport-agnostic so they run identically against the live
client and the in-memory test relay.
Functions§
- delete_
own_ message - Delete a message the sender previously published, via its retained ephemeral key (NIP-09 — the deletion must be signed by the same key that signed the event, so only the original sender can delete their own message).
- fetch_
channel_ events - Raw fetch of every append-plane event — messages (3300), reactions (3301), edits (3302)
— for a channel’s CURRENT-epoch pseudonym. Backfill/cold-start primitive (“recent on
open”): unlike
fetch_channel_messagesthis returns the un-opened outer events of all sub-kinds so the caller can run them throughinbound::process_channel_batch, which opens, verifies, dedups (inner id), and applies reactions/edits to their target messages. - fetch_
channel_ messages - Fetch + open all messages across the channel’s held epochs. Events that fail to open (wrong key, splice, forged signature) are dropped, not surfaced.
- fetch_
channel_ page - Fetch one PAGE of a channel’s append-plane events (3300/3301/3302) for its current-epoch
pseudonym, newest-first, capped at
limit.until(seconds, inclusive) pages OLDER history — pass the oldest-known message’screated_atto step back a page; passNonefor the latest page. The Discord-style sync primitive: latest-page on open/join/boot, older-page when local DB history is exhausted on scroll-up. Returns raw outer events forinbound::process_channel_batch. - publish_
message - Seal
contentand publish it to the Community’s relays. - publish_
signed_ message - Publish a message whose inner authorship event was already signed externally (via the
active
NostrSigner— local keys OR a NIP-46 bunker). Mirrorspublish_messagebut is signer-agnostic, so bunker accounts can post (parity with DMs). Returns the published outer event + its retained ephemeral key.durable: control/moderation events (a hide, a presence-join that must reliably land so the sender stays in the observed recipient set) broadcast durably (per-relay retry); ordinary chat messages passfalsefor the latency-sensitive single-attempt path.