Skip to content

Commit

Permalink
Add member list event
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Staab committed Aug 23, 2023
1 parent 7d187b8 commit 4e32518
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions 87.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,18 @@ When posting to the group as a member, events MUST follow this scheme: `any:auth

When posting to the group as an admin, events MUST follow this scheme: `any:admin_key shared_key->[shared_key]`.

New members are invited using this scheme: `24:admin_key ?->[recipient]`. Multiple events are sent, each addressed to a single invitee directly. The rumor's `tags` MUST contain a single `privkey` tag containing the shared key and SHOULD contain one or more `r` tags to help clients find group messages.
New members are invited using this scheme: `24:admin_key ?->[recipient]`. Multiple events are sent, each addressed to a single invitee directly. The rumor's `tags` MUST contain a single `privkey` tag containing the shared key and SHOULD contain one or more `r` tags to help clients find group messages. It MAY also include any number of `p` tags to help clients build member lists.

```json
{
"kind": 24,
"content": "Just a regular key rotation, nothing to worry about, we definitely didn't leak a key",
"tags": [["privkey", "<new shared key>"], ["r", "wss://some-relay.com"]],
"tags": [
["privkey", "<new shared key>"],
["r", "wss://some-relay.com"],
["p", "<pubkey>"],
["p", "<pubkey>"]
],
}
```

Expand Down Expand Up @@ -98,13 +103,25 @@ Any group member may request a key rotation: `26:author ?->[admin_key]`. The rum
}
```

## Key Rotation Notification
## Members Added Notifications

When a key rotation is performed, the admin MAY publish a `27:admin_key shared_key->[shared_key]` with a `p` tag for each member being removed from the group. The rumor MUST be addressed to the **now-invalid** shared key. This helps people build member lists and know what groups they are a part of.
When a key rotation is performed, the admin MAY publish a `27:admin_key shared_key->[shared_key]` with a `p` tag for each member in the group. The rumor MUST be addressed to the **new** shared key. This helps people build member lists and know what groups they are a part of. If the member list is very large, multiple events MAY be published with the same key, each with a subset of `p` tags.

```json
{
"kind": 27,
"content": "Welcome, Gary!",
"tags": [["p", "<pubkey>"], ["p", "<pubkey>"]],
}
```

## Members Removed Notifications

When a key rotation is performed, the admin MAY publish a `28:admin_key shared_key->[shared_key]` with a `p` tag for each member being removed from the group. The rumor MUST be addressed to the **now-invalid** shared key. This helps people build member lists and know what groups they are a part of. If the list of members removed is very large, multiple events MAY be published with the same key, each with a subset of `p` tags.

```json
{
"kind": 28,
"content": "Shame, shame",
"tags": [["p", "<pubkey>"]],
}
Expand Down

0 comments on commit 4e32518

Please sign in to comment.