Add section for custom NIP configs

This commit is contained in:
arthurfranca 2023-06-21 10:17:37 -03:00
parent 4fc1037dfb
commit c9e787995a

47
35.md
View File

@ -19,15 +19,15 @@ Also one may want to discover his friends' groups.
## Status Event ## Status Event
It is a kind `34549` parameterized replaceable event (PRE) with: It is a kind `34549` parameterized replaceable event (PRE) with:
- `d` tag is a reference to the group creation event as `<kind>:<pubkey>:<d-identifier>` if PRE or `<kind>:<pubkey>` if replaceable or `<event id>` if regular event; - `d` tag which is a reference to the group creation event as `<kind>:<pubkey>:<d-identifier>` if PRE or `<kind>:<pubkey>` if replaceable or `<event id>` if regular event;
- `k` tag as `<group creation event kind>` for discoverability; - `k` tag as `<group creation event kind>` for discoverability;
- optional `status` tag (see ["Custom Status" section](#custom-status)); - optional `status` tag (see ["Custom Status" section](#custom-status));
- [NIP-40](40.md) `expiration` tag that should be 60 days ahead of the `created_at` tag value; - [NIP-40](40.md) `expiration` tag that should be by default 60 days ahead of the `created_at` tag value;
- `.content` as stringified author kind 0 event JSON for fast lookup. - `.content` as stringified author kind 0 event JSON for fast lookup.
The event should be replaced by clients from time to time The event by default MUST be replaced by clients from time to time
(lower than 10 min window - see ["Basic Status" section](#custom-status)), (usually at a frequency lower than 10 minutes window so that the user
for example every 7 minutes the user is browsing a group. is not considered `away` - see ["Basic Status" section](#basic-status)).
If the `created_at` tag age (`now - created_at`) is higher than 10 minutes, If the `created_at` tag age (`now - created_at`) is higher than 10 minutes,
the client should consider the `.content` stale for important things such as zap address. the client should consider the `.content` stale for important things such as zap address.
@ -55,7 +55,7 @@ the client should consider the `.content` stale for important things such as zap
Basic status don't rely on `status` tags. Basic status don't rely on `status` tags.
Clients find out the user status by the following rules regarding status event's `created_at` age: Clients find out the user status by the following rules regarding status event's `created_at` age:
| Age | Status | | Status Event Age | User Status |
| -------------------------------------- | ------------------------------ | | -------------------------------------- | ------------------------------ |
| (now - created_at) < 0 | *invalid status, not a member* | | (now - created_at) < 0 | *invalid status, not a member* |
| 0 <= (now - created_at) < 10 min | online | | 0 <= (now - created_at) < 10 min | online |
@ -64,14 +64,26 @@ Clients find out the user status by the following rules regarding status event's
| 5 days <= (now - created_at) < 60 days | inactive | | 5 days <= (now - created_at) < 60 days | inactive |
| 60 days <= (now - created_at)` | *not a member* | | 60 days <= (now - created_at)` | *not a member* |
An user is invisible if it deletes the status event or had never published it. Clients by default MUST update the status event every 7 minutes user is browsing a group.
Invisible should be the default status when joining (browsing) a group.
An user is considered `invisible` if it deletes the status event or had never published it.
The `invisible` status should be the default for most use cases when joining (browsing) a group.
### Special Case
Some group NIPs may define bespoke status event update frequency along with expiration tag value and basic status tables.
| NIP | Name | Configuration |
| ------------- | --------------- | ------------------------------------ |
| [102](102.md) | Live Activities | [#live-activities](#live-activities) |
## Custom Status ## Custom Status
Clients can choose to support extra custom status that may override the basic ones Clients can choose to support extra custom status that may override the basic ones
by using `status` tags; even multiple `status` tags at once. by using `status` tags; even multiple `status` tags at once.
For example, a client may add a tag `["status", "offline"]` right after user leaves a group view.
The following are the standardized `status` tag values: The following are the standardized `status` tag values:
- "online" - "online"
- "away" - "away"
@ -79,3 +91,22 @@ The following are the standardized `status` tag values:
- "inactive" - "inactive"
- "busy" - "busy"
- "free-for-chat" - "free-for-chat"
## Live Activities
When joining a NIP-102 Live Activity the default status is `online` instead of `invisible`.
| User Role | Status Event Update Frequency | Status Event NIP-40 Epiration Tag |
| -------------- | ------------------------------ | --------------------------------- |
| Host / Speaker | 1 min 30 s | created_at + 10 min |
| Participant | 5 min 15 s | created_at + 10 min |
| Status Event Age | User Role | User Status |
| ----------------------------------------- | -------------- | ----------------------------------- |
| (now - created_at) < 0 | *All* | *invalid status, not participating* |
| 0 <= (now - created_at) < 2 min 15 s | Host / Speaker | online |
| 2 min 15 s <= (now - created_at) < 10 min | Host / Speaker | offline |
| 10 min <= (now - created_at) | Host / Speaker | *not participating* |
| 0 <= (now - created_at) < 6 min | Participant | online |
| 6 <= (now - created_at) < 10 min | Participant | offline |
| 10 min <= (now - created_at) | Participant | *not participating* |