3. Direct-Message Host Stores (fleetmesh_protocols.dm)#
fleetmesh_protocols.dm implements the host-side storage components for direct messaging: the bilateral mailbox, which restricts access to each message’s two participating identities, and the spool, which accepts posted DIDComm v2 envelopes, peer records, and typing indicators. Its browser counterpart is @fleetmesh/dm.
3.1. Mailbox#
Direct-message mailbox (node.protocols.dm.mailbox): each message is its two parties’ alone.
A message is filed once, with the principal keys of who may read it (_holders): a sent message its sender (the session, never a sender the body names) and its recipient; an inbound envelope a recipient brings in from their Leaf inbox, that recipient only (its sender is a claim this node cannot check). Everything is read as a viewer: their own conversations (grouped by the other party), their own pins, titles, deletions and read marks (_dm_views), never anyone else’s.
A message sealed by its sender (sealed_content: NIP-44 between the two parties’ nostr keys, which both can open) is kept without plaintext: no content, no attachments, no preview.
- fleetmesh_protocols.dm.mailbox.load_dm_mailbox(eng)[source]#
- Parameters:
eng (Any)
- Return type:
None
- fleetmesh_protocols.dm.mailbox.viewer_messages(eng, viewer)[source]#
The messages viewer holds, oldest first.
- fleetmesh_protocols.dm.mailbox.viewer_conversations(eng, viewer)[source]#
The viewer’s conversations, with their messages and the viewer’s own settings.
- fleetmesh_protocols.dm.mailbox.get_dm_summary(eng, viewer=None)[source]#
The viewer’s mailbox; without a viewer, an empty one.
- Parameters:
- Return type:
- fleetmesh_protocols.dm.mailbox.record_message(eng, body, viewer, *, inbound)[source]#
File a message the viewer sent (inbound=False) or received through their Leaf inbox.
- fleetmesh_protocols.dm.mailbox.viewer_envelopes(eng, viewer, since=0, peer_did='')[source]#
The viewer’s messages as spool envelopes, optionally since a time and with one peer.
3.2. Spool#
Sovereign DIDComm v2 & Encrypted JWE Spool Engine (node.protocols.dm.spool).
Consolidates Inbox & Outbox state around instance-agnostic did:nostr:<64-hex> identities, deduplicates hybrid (Leaf mediator + server spool) envelopes by msg_id, and supports cross-node encrypted JWE spool & key-binding sync without tying users to instances.
- fleetmesh_protocols.dm.spool.ensure_dm_spool_fields(eng)[source]#
- Parameters:
eng (Any)
- Return type:
None
- fleetmesh_protocols.dm.spool.get_active_typing_indicators(eng, scope=None, target_id=None, viewer=None)[source]#
Who is typing, as viewer may see it: a DM’s typing its two parties, a private circle’s its members.
- fleetmesh_protocols.dm.spool.record_typing_indicator(eng, body, principal=None)[source]#
Record (or clear) the session’s typing; the typer is the session, never one the body names.