mirror of
https://github.com/nostr-protocol/nips.git
synced 2025-04-02 09:00:23 +02:00
NIP-10: Add marked p tags
This commit is contained in:
parent
405cf480e9
commit
c0dfa2f6f7
30
10.md
30
10.md
@ -37,7 +37,7 @@ They are citings from this event. `root-id` and `reply-id` are as above.
|
||||
|
||||
>This scheme is deprecated because it creates ambiguities that are difficult, or impossible to resolve when an event references another but is not a reply.
|
||||
|
||||
## Marked "e" tags (PREFERRED)
|
||||
## Marked "e" tags (RECOMMENDED)
|
||||
`["e", <event-id>, <relay-url>, <marker>]`
|
||||
|
||||
Where:
|
||||
@ -54,9 +54,33 @@ A direct reply to the root of a thread should have a single marked "e" tag of ty
|
||||
|
||||
|
||||
## The "p" tag
|
||||
Used in a text event contains a list of pubkeys used to record who is involved in a reply thread.
|
||||
|
||||
When replying to a text event E the reply event's "p" tags should contain all of E's "p" tags as well as the `"pubkey"` of the event being replied to.
|
||||
### Unmarked "p" tags (DEPRECATED)
|
||||
Used in a text event to record who is involved in a reply thread and mentions.
|
||||
Any `p` tags from the event that is replied to, the public key of the event replied to, and the public keys mentioned are added to tags.
|
||||
|
||||
Example: Given a text event authored by `a1` with "p" tags [`p1`, `p2`, `p3`] then the "p" tags of the reply should be [`a1`, `p1`, `p2`, `p3`]
|
||||
in no particular order.
|
||||
|
||||
### Marked "p" tags (RECOMMENDED)
|
||||
|
||||
`["p", <pubkey>, <relay>, <type>]`
|
||||
|
||||
|
||||
- `<pubkey>` is the public key being referenced.
|
||||
- `<relay-url>` is the URL of a recommended relay associated with this public key. This is optional and may be an empty string.
|
||||
- `<type>` is required. It can be:
|
||||
- `reply`: This public key is involved in the reply thread.
|
||||
- `mention`: This public key is mentioned in this note or was in the reply thread.
|
||||
- `silent`: This public key is being referenced in this note but should not be notified (such as public key lists).
|
||||
- A blank string.
|
||||
|
||||
A client should follow the following steps while creating a note.
|
||||
A `p` tag should not be added if one with the same type and pubkey exists in the tag list.
|
||||
|
||||
1. Copy any `p` tags from the event being replied to, if any, except ones with the type `silent`.
|
||||
- If there are p tags without a type string (blank strings are fine), they should be copied over with a `type` of `reply` and a relay may be optionally set if the client has that information.
|
||||
2. Add a `p` tag with the pubkey of the event being replied to, if any, with the type `reply`.
|
||||
3. Add any `p` tags that are mentioned with the types `mention` or `silent` depending on if the user wants to silently mention someone.
|
||||
|
||||
Clients SHOULD NOT show notifications from events with `p` tags mentioning this user with the type `silent`.
|
Loading…
x
Reference in New Issue
Block a user