mirror of
https://github.com/nostr-protocol/nips.git
synced 2024-12-22 08:25:53 -05:00
Change wording to imply that reactions can target any event (#815)
* kind:17 generic reactions. * `kind 7` is available for all kind events. * `k` tag is not required.
This commit is contained in:
parent
21c6c12c52
commit
324c7aafdc
6
25.md
6
25.md
|
@ -7,7 +7,7 @@ Reactions
|
||||||
|
|
||||||
`draft` `optional` `author:jb55`
|
`draft` `optional` `author:jb55`
|
||||||
|
|
||||||
A reaction is a `kind 7` note that is used to react to other notes.
|
A reaction is a `kind 7` event that is used to react to other events.
|
||||||
|
|
||||||
The generic reaction, represented by the `content` set to a `+` string, SHOULD
|
The generic reaction, represented by the `content` set to a `+` string, SHOULD
|
||||||
be interpreted as a "like" or "upvote".
|
be interpreted as a "like" or "upvote".
|
||||||
|
@ -34,6 +34,9 @@ The last `e` tag MUST be the `id` of the note that is being reacted to.
|
||||||
|
|
||||||
The last `p` tag MUST be the `pubkey` of the event being reacted to.
|
The last `p` tag MUST be the `pubkey` of the event being reacted to.
|
||||||
|
|
||||||
|
The reaction event MAY include a `k` tag with the stringified kind number
|
||||||
|
of the reacted event as its value.
|
||||||
|
|
||||||
Example code
|
Example code
|
||||||
|
|
||||||
```swift
|
```swift
|
||||||
|
@ -43,6 +46,7 @@ func make_like_event(pubkey: String, privkey: String, liked: NostrEvent) -> Nost
|
||||||
}
|
}
|
||||||
tags.append(["e", liked.id])
|
tags.append(["e", liked.id])
|
||||||
tags.append(["p", liked.pubkey])
|
tags.append(["p", liked.pubkey])
|
||||||
|
tags.append(["k", liked.kind])
|
||||||
let ev = NostrEvent(content: "+", pubkey: pubkey, kind: 7, tags: tags)
|
let ev = NostrEvent(content: "+", pubkey: pubkey, kind: 7, tags: tags)
|
||||||
ev.calculate_id()
|
ev.calculate_id()
|
||||||
ev.sign(privkey: privkey)
|
ev.sign(privkey: privkey)
|
||||||
|
|
|
@ -157,7 +157,7 @@ Please update these lists when proposing NIPs introducing new event kinds.
|
||||||
## Standardized Tags
|
## Standardized Tags
|
||||||
|
|
||||||
| name | value | other parameters | NIP |
|
| name | value | other parameters | NIP |
|
||||||
| ----------------- | ------------------------------------ | -------------------- | ------------------------ |
|
| ----------------- | ------------------------------------ | -------------------- | ------------------------------------- |
|
||||||
| `e` | event id (hex) | relay URL, marker | [01](01.md), [10](10.md) |
|
| `e` | event id (hex) | relay URL, marker | [01](01.md), [10](10.md) |
|
||||||
| `p` | pubkey (hex) | relay URL, petname | [01](01.md), [02](02.md) |
|
| `p` | pubkey (hex) | relay URL, petname | [01](01.md), [02](02.md) |
|
||||||
| `a` | coordinates to an event | relay URL | [01](01.md) |
|
| `a` | coordinates to an event | relay URL | [01](01.md) |
|
||||||
|
@ -165,7 +165,7 @@ Please update these lists when proposing NIPs introducing new event kinds.
|
||||||
| `alt` | summary | -- | [31](31.md) |
|
| `alt` | summary | -- | [31](31.md) |
|
||||||
| `g` | geohash | -- | [52](52.md) |
|
| `g` | geohash | -- | [52](52.md) |
|
||||||
| `i` | identity | proof | [39](39.md) |
|
| `i` | identity | proof | [39](39.md) |
|
||||||
| `k` | kind number (string) | -- | [18](18.md), [72](72.md) |
|
| `k` | kind number (string) | -- | [18](18.md), [25](25.md), [72](72.md) |
|
||||||
| `l` | label, label namespace | annotations | [32](32.md) |
|
| `l` | label, label namespace | annotations | [32](32.md) |
|
||||||
| `L` | label namespace | -- | [32](32.md) |
|
| `L` | label namespace | -- | [32](32.md) |
|
||||||
| `m` | MIME type | -- | [94](94.md) |
|
| `m` | MIME type | -- | [94](94.md) |
|
||||||
|
|
Loading…
Reference in New Issue
Block a user