From 50db74f93a1c46cc884d91beaa6b7be05a6079ff Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Wed, 22 Nov 2023 10:15:11 -0300 Subject: [PATCH] `public` and `open` tags and join request event. --- 29.md | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/29.md b/29.md index 623e15f..93b0edf 100644 --- a/29.md +++ b/29.md @@ -66,17 +66,32 @@ Similar to `kind:11`, this is the basic unit of a chat message sent to a group. ... ``` -- *moderation events* (`kinds:5;9000-9020`) (optional) +- *join request* (`kind:9021`) + +Any user can send one of these events to the relay in order to be automatically or manually added to the group. If the group is `open` the relay will automatically issue a `kind:9000` in response adding this user. Otherwise group admins may choose to query for these requests and act upon them. + +```js +{ + "kind": 9021, + "content": "optional reason", + "tags": [ + ["h", ""], + ["alt", "optional action description"] + ] +} +``` + +- *moderation events* (`kinds:9000-9020`) (optional) Clients can send these events to a relay in order to accomplish a moderation action. Relays must check if the pubkey sending the event is capable of performing the given action. The relay may discard the event after taking action or keep it as a moderation log. ```js { "kind": 90xx, - "content": "", + "content": "optional reason", "tags": [ ["h", ""], - ["alt", "optional action description and/or reason"], + ["alt", "optional action description"], ["previous", ...] ] } @@ -107,12 +122,16 @@ If the group is forked and hosted in multiple relays, there will be multiple ver ["d", ""], ["name", "Pizza Lovers"], ["picture", "https://pizza.com/pizza.png"], - ["about", "a group for people who love pizza"] + ["about", "a group for people who love pizza"], + ["public"], + ["open"] ] ... } ``` +`name`, `picture` and `about` are basic metadata for the group for display purposes. `public` signals the group can be _read_ by anyone. `open` signals that anyone can request to join and the request will be automatically granted. + The [NIP-19](19.md) `naddr` pointer for this event including with a mandatory relay can be used as the canonical group identifier. - *group admins* (`kind:39001`) (optional)