diff options
Diffstat (limited to '17.md')
| -rw-r--r-- | 17.md | 10 |
1 files changed, 5 insertions, 5 deletions
| @@ -12,18 +12,18 @@ This NIP defines an encrypted direct messaging scheme using [NIP-44](44.md) encr | |||
| 12 | 12 | ||
| 13 | Kind `14` is a chat message. `p` tags identify one or more receivers of the message. | 13 | Kind `14` is a chat message. `p` tags identify one or more receivers of the message. |
| 14 | 14 | ||
| 15 | ```js | 15 | ```jsonc |
| 16 | { | 16 | { |
| 17 | "id": "<usual hash>", | 17 | "id": "<usual hash>", |
| 18 | "pubkey": "<sender-pubkey>", | 18 | "pubkey": "<sender-pubkey>", |
| 19 | "created_at": now(), | 19 | "created_at": "<current-time>", |
| 20 | "kind": 14, | 20 | "kind": 14, |
| 21 | "tags": [ | 21 | "tags": [ |
| 22 | ["p", "<receiver-1-pubkey>", "<relay-url>"], | 22 | ["p", "<receiver-1-pubkey>", "<relay-url>"], |
| 23 | ["p", "<receiver-2-pubkey>", "<relay-url>"], | 23 | ["p", "<receiver-2-pubkey>", "<relay-url>"], |
| 24 | ["e", "<kind-14-id>", "<relay-url>", "reply"] // if this is a reply | 24 | ["e", "<kind-14-id>", "<relay-url>", "reply"] // if this is a reply |
| 25 | ["subject", "<conversation-title>"], | 25 | ["subject", "<conversation-title>"], |
| 26 | ... | 26 | // rest of tags... |
| 27 | ], | 27 | ], |
| 28 | "content": "<message-in-plain-text>", | 28 | "content": "<message-in-plain-text>", |
| 29 | } | 29 | } |
| @@ -86,7 +86,7 @@ Clients CAN offer disappearing messages by setting an `expiration` tag in the gi | |||
| 86 | 86 | ||
| 87 | Kind `10050` indicates the user's preferred relays to receive DMs. The event MUST include a list of `relay` tags with relay URIs. | 87 | Kind `10050` indicates the user's preferred relays to receive DMs. The event MUST include a list of `relay` tags with relay URIs. |
| 88 | 88 | ||
| 89 | ```js | 89 | ```jsonc |
| 90 | { | 90 | { |
| 91 | "kind": 10050, | 91 | "kind": 10050, |
| 92 | "tags": [ | 92 | "tags": [ |
| @@ -94,7 +94,7 @@ Kind `10050` indicates the user's preferred relays to receive DMs. The event MUS | |||
| 94 | ["relay", "wss://myrelay.nostr1.com"], | 94 | ["relay", "wss://myrelay.nostr1.com"], |
| 95 | ], | 95 | ], |
| 96 | "content": "", | 96 | "content": "", |
| 97 | //...other fields | 97 | // other fields... |
| 98 | } | 98 | } |
| 99 | ``` | 99 | ``` |
| 100 | 100 | ||