Skip to main content

Module deletion

Module deletion 

Source
Expand description

Message deletion — Vector’s “delete from network” capability.

NIP-17 DMs are wrapped in kind-1059 gift-wrap events signed by an ephemeral key. The standard NIP-59 implementation discards that key after signing, making the wrap permanently un-deletable: privacy by obscurity, since the wrap continues to sit on inbox relays decryptable by anyone with the recipient key.

Vector retains the ephemeral key (see db::nip17_keys) so that on user request we can publish an author-signed NIP-09 deletion against every wrap and have relays drop it. Privacy by control.

Scope: this module deletes the user’s own outbound messages. It does not (and cannot) delete messages sent by others — those wraps were signed by ephemeral keys we never held.

Structs§

DeleteOutcome
Outcome of a delete-own-* operation.

Functions§

delete_cached_attachment_files_pub
Best-effort delete of every cached attachment file for a message. Only unlinks files that canonicalize to a path under Vector’s managed download directory — files the user has moved or copied elsewhere are never touched. Symlink and .. escape attempts are rejected by the canonicalize check.
delete_own_dm
Delete an outbound DM from the network by publishing NIP-09 deletions against every retained gift-wrap for rumor_id.
filter_unreferenced_attachments
Filter attachments down to those NOT referenced by any OTHER undeleted message in STATE.