upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/25.md
diff options
context:
space:
mode:
authorDon <ukanikola@gmail.com>2023-10-11 20:55:27 +0900
committerGitHub <noreply@github.com>2023-10-11 08:55:27 -0300
commit324c7aafdcd316fb971c1f26b964d2b53c939a10 (patch)
tree9a6d527d87bee9871dcc6871b4dc65b395c4aaef /25.md
parent21c6c12c524cb71f18e068c9bcf223cda0214b5f (diff)
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.
Diffstat (limited to '25.md')
-rw-r--r--25.md6
1 files changed, 5 insertions, 1 deletions
diff --git a/25.md b/25.md
index 63c07a7..7b29140 100644
--- a/25.md
+++ b/25.md
@@ -7,7 +7,7 @@ Reactions
7 7
8`draft` `optional` `author:jb55` 8`draft` `optional` `author:jb55`
9 9
10A reaction is a `kind 7` note that is used to react to other notes. 10A reaction is a `kind 7` event that is used to react to other events.
11 11
12The generic reaction, represented by the `content` set to a `+` string, SHOULD 12The generic reaction, represented by the `content` set to a `+` string, SHOULD
13be interpreted as a "like" or "upvote". 13be 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.
34 34
35The last `p` tag MUST be the `pubkey` of the event being reacted to. 35The last `p` tag MUST be the `pubkey` of the event being reacted to.
36 36
37The reaction event MAY include a `k` tag with the stringified kind number
38of the reacted event as its value.
39
37Example code 40Example code
38 41
39```swift 42```swift
@@ -43,6 +46,7 @@ func make_like_event(pubkey: String, privkey: String, liked: NostrEvent) -> Nost
43 } 46 }
44 tags.append(["e", liked.id]) 47 tags.append(["e", liked.id])
45 tags.append(["p", liked.pubkey]) 48 tags.append(["p", liked.pubkey])
49 tags.append(["k", liked.kind])
46 let ev = NostrEvent(content: "+", pubkey: pubkey, kind: 7, tags: tags) 50 let ev = NostrEvent(content: "+", pubkey: pubkey, kind: 7, tags: tags)
47 ev.calculate_id() 51 ev.calculate_id()
48 ev.sign(privkey: privkey) 52 ev.sign(privkey: privkey)