diff options
| author | hodlbod <jstaab@protonmail.com> | 2024-11-21 06:55:23 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-21 11:55:23 -0300 |
| commit | 1e47fd75572704b84cf484ce52394fc7ea7d4067 (patch) | |
| tree | a95fbc731f2fdf9ac778a6a5be52b5389c2f8b2e | |
| parent | 84aeb10d395d0b9a3379c81aacf5b1ff4d675499 (diff) | |
Break out chat and threads from nip 29 (#1591)
| -rw-r--r-- | 29.md | 34 | ||||
| -rw-r--r-- | 7D.md | 34 | ||||
| -rw-r--r-- | C7.md | 29 |
3 files changed, 64 insertions, 33 deletions
| @@ -64,39 +64,7 @@ These are the events expected to be found in NIP-29 groups. | |||
| 64 | 64 | ||
| 65 | ### Normal user-created events | 65 | ### Normal user-created events |
| 66 | 66 | ||
| 67 | These events generally can be sent by all members of a group and they require the `h` tag to be present so they're attached to a specific group. | 67 | Groups may accept any event kind, including chats, threads, long-form articles, calendar, livestreams, market announcements and so on. These should be as defined in their respective NIPs, with the addition of the `h` tag. |
| 68 | |||
| 69 | - _chat message_ (`kind:9`) | ||
| 70 | |||
| 71 | This is the basic unit of a _chat message_ sent to a group. | ||
| 72 | |||
| 73 | ```jsonc | ||
| 74 | "kind": 9, | ||
| 75 | "content": "hello my friends lovers of pizza", | ||
| 76 | "tags": [ | ||
| 77 | ["h", "<group-id>"], | ||
| 78 | ["previous", "<event-id-first-chars>", "<event-id-first-chars>", /*...*/] | ||
| 79 | ] | ||
| 80 | // other fields... | ||
| 81 | ``` | ||
| 82 | |||
| 83 | - _thread root post_ (`kind:11`) | ||
| 84 | |||
| 85 | This is the basic unit of a forum-like root thread post sent to a group. | ||
| 86 | |||
| 87 | ```jsonc | ||
| 88 | "kind": 11, | ||
| 89 | "content": "hello my friends lovers of pizza", | ||
| 90 | "tags": [ | ||
| 91 | ["h", "<group-id>"], | ||
| 92 | ["previous", "<event-id-first-chars>", "<event-id-first-chars>", /*...*/] | ||
| 93 | ] | ||
| 94 | // other fields... | ||
| 95 | ``` | ||
| 96 | |||
| 97 | - _other events_: | ||
| 98 | |||
| 99 | Groups may also accept other events, like [NIP-22](22.md) comments as threaded replies to both chats messages and threads, long-form articles, calendar, livestreams, market announcements and so on. These should be as defined in their respective NIPs, with the addition of the `h` tag. | ||
| 100 | 68 | ||
| 101 | ### User-related group management events | 69 | ### User-related group management events |
| 102 | 70 | ||
| @@ -0,0 +1,34 @@ | |||
| 1 | NIP-7D | ||
| 2 | ====== | ||
| 3 | |||
| 4 | Threads | ||
| 5 | ------- | ||
| 6 | |||
| 7 | `draft` `optional` | ||
| 8 | |||
| 9 | A thread is a `kind 11` event. Threads SHOULD include a `subject` with a summary | ||
| 10 | of the thread's topic. | ||
| 11 | |||
| 12 | ```json | ||
| 13 | { | ||
| 14 | "kind": 11, | ||
| 15 | "content": "Good morning", | ||
| 16 | "tags": [ | ||
| 17 | ["subject", "GM"] | ||
| 18 | ] | ||
| 19 | } | ||
| 20 | ``` | ||
| 21 | |||
| 22 | Replies to `kind 11` MUST use [NIP-22](./22.md) `kind 1111` comments. Replies should | ||
| 23 | always be to the root `kind 11` to avoid arbitrarily nested reply hierarchies. | ||
| 24 | |||
| 25 | ```json | ||
| 26 | { | ||
| 27 | "kind": 1111, | ||
| 28 | "content": "Cool beans", | ||
| 29 | "tags": [ | ||
| 30 | ["K", "11"], | ||
| 31 | ["E", <event-id>, <relay-url>, <pubkey>] | ||
| 32 | ] | ||
| 33 | } | ||
| 34 | ``` | ||
| @@ -0,0 +1,29 @@ | |||
| 1 | NIP-C7 | ||
| 2 | ====== | ||
| 3 | |||
| 4 | Chats | ||
| 5 | ----- | ||
| 6 | |||
| 7 | `draft` `optional` | ||
| 8 | |||
| 9 | A chat message is a `kind 9` event. | ||
| 10 | |||
| 11 | ```json | ||
| 12 | { | ||
| 13 | "kind": 9, | ||
| 14 | "content": "GM", | ||
| 15 | "tags": [] | ||
| 16 | } | ||
| 17 | ``` | ||
| 18 | |||
| 19 | A reply to a `kind 9` is an additional `kind 9` which quotes the parent using a `q` tag. | ||
| 20 | |||
| 21 | ```json | ||
| 22 | { | ||
| 23 | "kind": 9, | ||
| 24 | "content": "nostr:nevent1...\nyes", | ||
| 25 | "tags": [ | ||
| 26 | ["q", <event-id>, <relay-url>, <pubkey>] | ||
| 27 | ] | ||
| 28 | } | ||
| 29 | ``` | ||