From 594c33bed03b2a096985336a475ce815a37d707d Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Mon, 21 Oct 2024 13:45:51 -0300 Subject: [PATCH] rename "claim"=>"code", get rid of kind 9006 (just use 9000), add a paragraph explaining moderation. --- 29.md | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/29.md b/29.md index c0dbcef7..c4ee4952 100644 --- a/29.md +++ b/29.md @@ -42,6 +42,14 @@ This is a hack to prevent messages from being broadcasted to external relays tha Relays should prevent late publication (messages published now with a timestamp from days or even hours ago) unless they are open to receive a group forked or moved from another relay. +## Group management + +Groups can have any number of users with elevated access. These users are identified by role labels which are arbitrarily defined by the relays (see also the description of `kind:39003`). What each role is capable of not defined in this NIP either, it's a relay policy that can vary. Roles can be assigned by other users (as long as they have the capability to add roles) by publishing a `kind:9000` event with that user's pubkey in a `p` tag and the roles afterwards (even if the user is already a group member a `kind:9000` can be issued and the user roles must just be updated). + +The roles supported by the group as to having some special privilege assigned to them should be accessible on the event `kind:39003`, but the relay may also accept other role names, arbitrarily defined by clients, and just not do anything with them. + +Users with any roles that have any privilege can be considered _admins_ in a broad sense and be returned in the `kind:39001` event for a group. + ## Unmanaged groups Unmanaged groups are impromptu groups that can be used in any public relay unaware of NIP-29 specifics. They piggyback on relays' natural white/blacklists (or lack of) but aside from that are not actively managed and won't have any admins, group state or metadata events. @@ -117,12 +125,12 @@ Any user can send one of these events to the relay in order to be automatically "content": "optional reason", "tags": [ ["h", ""], - ["claim", ""] + ["code", ""] ] } ``` -The optional `claim` tag may be used by the relay to preauthorize acceptances in `closed` groups, together with the `kind:9009` `create-invite` moderation event. +The optional `code` tag may be used by the relay to preauthorize acceptances in `closed` groups, together with the `kind:9009` `create-invite` moderation event. - *leave request* (`kind:9022`) @@ -161,13 +169,10 @@ Each moderation action uses a different kind and requires different arguments, w | kind | name | tags | | --- | --- | --- | -| 9000 | `add-user` | `p` with pubkey hex | +| 9000 | `add-user` | `p` with pubkey hex and optional roles | | 9001 | `remove-user` | `p` with pubkey hex | | 9002 | `edit-metadata` | fields from `kind:39000` to be modified | -| 9003 | | | -| 9004 | | | | 9005 | `delete-event` | | -| 9006 | `set-role` | `p` with pubkey hex and roles | | 9007 | `create-group` | | | 9008 | `delete-group` | |