Skip to main content

Module session

Module session 

Source
Expand description

A joined realtime session: one Mini App instance’s gossip topic, the players on it, and the Nostr signalling that lets them find each other.

Structs§

JoinOptions
How a session is joined.
XdcFrame
One frame an app (or another bot) sent on the channel.
XdcPeer
A peer on the mesh. npub is the account whose advertisement first named this node in this chat; None until one has, or once two accounts have claimed the same node.
XdcSender
Sends on a session from anywhere; see XdcSession::sender.
XdcSession
A live realtime session. Dropping it leaves.

Enums§

XdcEvent

Constants§

ATTRIBUTION_WAIT
How long a node’s frames wait for an advertisement to name their sender. The advertisement travels over Nostr and the first frames straight over the mesh, so they usually arrive first.

Functions§

allow_outside_tor
allow_outside_transport, under its original name.
allow_outside_transport
Let sessions run outside the chosen network (Tor, I2P). Iroh connects directly, so session peers and the Iroh relay see this machine’s IP; the app asks the user the same question.
any_live
Whether the live account is in any realtime session.
apply_signal
Apply an ingested signal to a live session this account is in: learn the sender’s node, dial an advertised peer, report a departure. Returns false when no live session is on the topic.
is_joined
Whether this account is in the session on topic (base32), and not leaving it.
join
Join the session on topic (the webxdc-topic an app’s message carries) in chat_id (a DM npub or Community channel id): dial everyone already advertised there, then advertise ourselves so the rest can dial us.
join_with
join with options.
leave_all
Leave every session of the account now logged in, for an account swap: it seals the account’s registry for good, so no join can slip in behind the teardown. Everything local happens next and unconditionally, the account’s mesh is closed (the next account binds a fresh node key), and the departure signals go last, together, within deadline. Abandoned part-way, the account refuses new sessions until it next logs in.
leave_all_for_switch
leave_all for a network switch: the account stays open, so later joins (with consent for the new network) still work. The mesh closes once nothing uses it.