Expand description
Message sending — NIP-17 gift-wrapped DMs (text and file attachments).
This is the core send pipeline used by all Vector interfaces (GUI, CLI, SDK).
Clients provide a SendCallback for status notifications (pending/sent/failed/progress)
and a SendConfig for retry/cancel behavior.
Structs§
- NoOp
Send Callback - No-op callback for headless/CLI/test use.
- Send
Config - Configuration for a send operation.
- Send
Result - Result of sending a message.
- Temp
File - Removes a file when dropped: the ciphertext of an upload that ended either way.
Enums§
- File
Source - Where an outgoing file’s bytes come from.
- Sealed
- An outgoing attachment, ready for the upload.
Constants§
- NIP59_
RANDOM_ TIMESTAMP_ TWEAK - NIP-59’s gift-wrap backdating window (0 to 2 days).
Traits§
- Send
Callback - Callbacks invoked during the DM send pipeline.
Functions§
- abandon_
failed_ send - Give up on a failed send for good. Its uploads leave the media servers only once nothing signed can still be read with them: no message was ever built, or its take-back is on a relay. A message that failed here may have landed, or may land yet, and would point at them.
- discard_
retry_ copy - Forget what a failed send of
attkept to go again: its sealed copies and its bubble’s source. - failure_
line - The first line of a failure, as a row can show it: a list of per-server reasons is summed up by its heading.
- keep_
for_ retry - A failed upload’s ciphertext, kept for its retry: written out when it was sealed in memory.
- keep_
sent - Mark a pending file message failed (in state, in the UI, on disk) and hand back
err. Keep a sent blob in the store: the file moves in, bytes in hand are written there. - note_
relay_ ok - Feed a relay
OKfor an outbound event back into the send pipeline. - resend_
failed_ dm - Manually retry a failed DM by republishing the EXACT retained recipient wrap. Same outer event id → relays no-op the duplicate, so a first send that silently landed can never double-post, regardless of the recipient’s client.
- retry_
source - What a failed send of
attcan go again from, best first: the sender’s own file, the bytes this account still holds, or the ciphertext its failed upload kept. - seal_
or_ reuse - Reuse a live blob of the plaintext
hash, or sealplainunderkey/nonce, reporting each stage againstpending_id. A file seals file to file, costing no memory. - send_dm
- send_
file_ dm - Send a NIP-17 gift-wrapped file attachment DM.
- send_
file_ dm_ from send_file_dm_with_metafrom either source.- send_
file_ dm_ with_ meta send_file_dmfor a caller that already holds the image’s preview metadata, sparing a second full decode before the bubble can appear.Nonederives it.- send_
rumor_ dm - Send a pre-built rumor via NIP-17 gift-wrap.
- sweep_
outgoing - Ciphertext of uploads that never went again, once it’s two weeks old, and plaintext working copies a send left behind, once they’re a day old.
- tweaked_
timestamp crate::clock::timestamp()backdated by a random offset inside the NIP-59 window.