Skip to main content

Module sending

Module sending 

Source
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§

NoOpSendCallback
No-op callback for headless/CLI/test use.
SendConfig
Configuration for a send operation.
SendResult
Result of sending a message.
TempFile
Removes a file when dropped: the ciphertext of an upload that ended either way.

Enums§

FileSource
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§

SendCallback
Callbacks invoked during the DM send pipeline.

Functions§

note_relay_ok
Feed a relay OK for 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.
seal_or_reuse
Reuse a live blob of the plaintext hash, or seal plain under key/nonce, reporting each stage against pending_id. A file seals file to file, costing no memory.
send_dm
Send a NIP-17 gift-wrapped text DM.
send_file_dm
Send a NIP-17 gift-wrapped file attachment DM.
send_file_dm_from
send_file_dm_with_meta from either source.
send_file_dm_with_meta
send_file_dm for a caller that already holds the image’s preview metadata, sparing a second full decode before the bubble can appear. None derives it.
send_rumor_dm
Send a pre-built rumor via NIP-17 gift-wrap.
tweaked_timestamp
Timestamp::now() backdated by a random offset inside the NIP-59 window.