Expand description
Community message attachments (NIP-92 imeta).
Unlike NIP-17 DMs (one media item per event), a Community message event carries its
caption in content plus one imeta tag per attachment — so a single message can
mix text and N files. Each imeta holds the per-file AES-GCM key+nonce (the NIP-17
attachment technique: fresh random key per file), so the Blossom ciphertext is only
decryptable by members who can open the event.
Functions§
- attachment_
from_ imeta - Parse a single
imetatag into anAttachment.Noneif the tag isn’t animetaor is missing the required url / decryption fields.download_dircomputes the (not-yet-downloaded) local target path, mirroring the DM file-attachment path. - attachment_
to_ imeta - Encode an
Attachmentas a NIP-92imetatag with Vector’s encryption fields. Entries are space-delimitedkey valuestrings (NIP-92 form); a value may contain spaces (e.g. a filename) since only the first space delimits key from value. - attachments_
from_ tags - Parse every
imetatag on an event into attachments, order preserved. Capped: a max-size event can carry ~1700 imeta tags, each becoming a persisted + in-STATE Attachment — bound the per-message amplification. - strip_
attachment_ urls - Strip attachment blob URLs that some clients (e.g. Armada) inline into the
message content IN ADDITION to the
imetatag. Vector renders the file from the imeta, so the inline copy is pure redundancy: it wastes storage and makes the frontend try to web-preview a raw (often encrypted) blob URL — which can’t decode, so it just errors. Display-only: the wire event and message id are untouched (we never re-sign), so this can’t affect dedup or authority.