mirror of
https://github.com/nostr-protocol/nips.git
synced 2025-12-20 13:38:50 +00: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:
6
25.md
6
25.md
@@ -7,7 +7,7 @@ Reactions
|
||||
|
||||
`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
|
||||
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 reaction event MAY include a `k` tag with the stringified kind number
|
||||
of the reacted event as its value.
|
||||
|
||||
Example code
|
||||
|
||||
```swift
|
||||
@@ -43,6 +46,7 @@ func make_like_event(pubkey: String, privkey: String, liked: NostrEvent) -> Nost
|
||||
}
|
||||
tags.append(["e", liked.id])
|
||||
tags.append(["p", liked.pubkey])
|
||||
tags.append(["k", liked.kind])
|
||||
let ev = NostrEvent(content: "+", pubkey: pubkey, kind: 7, tags: tags)
|
||||
ev.calculate_id()
|
||||
ev.sign(privkey: privkey)
|
||||
|
||||
Reference in New Issue
Block a user