diff options
| author | Adam Soltys <[email protected]> | 2026-09-14 19:25:06 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-09-14 19:25:06 -0700 |
| commit | b363da843ffcaea89a9ec11ce0cacc180a824f00 (patch) | |
| tree | cc50a312c77f19ba98f78f0cddcc85ab82d8e552 /src/dm.js | |
| parent | 2b63cdbd2eacbcbd031de6616147d467da8a7c3c (diff) | |
| download | coinosv3-b363da843ffcaea89a9ec11ce0cacc180a824f00.tar.gz coinosv3-b363da843ffcaea89a9ec11ce0cacc180a824f00.zip | |
A picture can be sent to a channel or a DM, encrypted, and read by Vector.
The composer grows a paper clip. A picked file is encrypted under a
fresh AES-GCM key and 16-byte nonce, the ciphertext uploaded to a public
Blossom host that takes anonymous blobs (blossom.ditto.pub, then
nostr.download as a fallback copy), and the pointer posted the way
Vector posts it: a kind-9 with empty content and a NIP-92 imeta tag
carrying url, mime, key, nonce, both hashes, size and dimensions. In a
DM it is a NIP-17 kind-15 file message with the same fields as flat
tags and the url as content, wrapped to the peer and to ourselves.
Kind-15 file messages are now accepted on receive too, rendered like
any attachment, and previewed as a photo in the thread list.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Diffstat (limited to 'src/dm.js')
| -rw-r--r-- | src/dm.js | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -108,7 +108,7 @@ export async function unwrapDM(wrap, skOrSigner) { const rumor = JSON.parse(await signer.decryptFrom(seal.pubkey, seal.content)); if (rumor.pubkey !== seal.pubkey) return null; if (rumor.id !== getEventHash({ ...rumor, id: undefined })) return null; - if (rumor.kind !== 14) return { rumor, author: seal.pubkey, peer: null }; + if (rumor.kind !== 14 && rumor.kind !== 15) return { rumor, author: seal.pubkey, peer: null }; const to = rumor.tags?.find((t) => t[0] === 'p')?.[1]; const mine = rumor.pubkey === signer.pubkey; return { rumor, author: seal.pubkey, peer: mine ? to : rumor.pubkey }; |
