NIP-29: Pin Messages

Admins may pin some of the messages to the top of the group.
This commit is contained in:
Sepehr Safari 2024-04-04 16:31:02 +03:30 committed by GitHub
parent b224f6d05d
commit 97db8d842b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

25
29.md
View File

@ -119,6 +119,9 @@ Each moderation action uses a different kind and requires different arguments, w
| 9004 | `remove-permission` | `p` (pubkey), `permission` (name) | | 9004 | `remove-permission` | `p` (pubkey), `permission` (name) |
| 9005 | `delete-event` | `e` (id hex) | | 9005 | `delete-event` | `e` (id hex) |
| 9006 | `edit-group-status` | `public` or `private`, `open` or `closed` | | 9006 | `edit-group-status` | `public` or `private`, `open` or `closed` |
| 9007 | `add-pin` | `e` (id hex) |
| 9008 | `remove-pin` | `e` (id hex) |
- *group metadata* (`kind:39000`) (optional) - *group metadata* (`kind:39000`) (optional)
@ -159,6 +162,8 @@ The list of capabilities, as defined by this NIP, for now, is the following:
- `add-permission` - `add-permission`
- `remove-permission` - `remove-permission`
- `edit-group-status` - `edit-group-status`
- `add-pin`
- `remove-pin`
```js ```js
{ {
@ -192,6 +197,26 @@ It's a NIP-51-like list of pubkeys that are members of the group. Relays might c
} }
``` ```
- *group pins* (`kind:39003`) (optional)
Admins may decide to pin one or more messages on top of the group.
Similar to *group members*, this event is supposed to be generated by relays that host the group.
It's a NIP-51-like list of events (e.g. kind 9, 10, 11, 12) that are pins of the group. Relays might choose to not to publish this information or to restrict what pubkeys can fetch it.
```json
{
"kind": 39003,
"content": "list of pins for the pizza lovers group",
"tags": [
["d", "<group-id>"],
["e", "<event-id1>"],
["e", "<event-id2>"],
]
}
```
## Storing the list of groups a user belongs to ## Storing the list of groups a user belongs to
A definition for kind `10009` was included in [NIP-51](51.md) that allows clients to store the list of groups a user wants to remember being in. A definition for kind `10009` was included in [NIP-51](51.md) that allows clients to store the list of groups a user wants to remember being in.