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:
Diffstat (limited to '25.md')
-rw-r--r--25.md19
1 files changed, 8 insertions, 11 deletions
diff --git a/25.md b/25.md
index 3b4aa59..17c203e 100644
--- a/25.md
+++ b/25.md
@@ -25,24 +25,22 @@ consider it a "+".
25Tags 25Tags
26---- 26----
27 27
28The reaction event SHOULD include `e` and `p` tags from the note the user is 28The reaction event SHOULD include `e` and `p` tags from the note the user is reacting to (and optionally `a` tags if the target is a replaceable event). This allows users to be notified of reactions to posts they were mentioned in. Including the `e` tags enables clients to pull all the reactions associated with individual posts or all the posts in a thread. `a` tags enables clients to seek reactions for all versions of a replaceable event.
29reacting to. This allows users to be notified of reactions to posts they were
30mentioned in. Including the `e` tags enables clients to pull all the reactions
31associated with individual posts or all the posts in a thread.
32 29
33The last `e` tag MUST be the `id` of the note that is being reacted to. 30The last `e` tag MUST be the `id` of the note that is being reacted to.
34 31
35The last `p` tag MUST be the `pubkey` of the event being reacted to. 32The last `p` tag MUST be the `pubkey` of the event being reacted to.
36 33
37The reaction event MAY include a `k` tag with the stringified kind number 34The `a` tag MUST contain the coordinates (`kind:pubkey:d-tag`) of the replaceable being reacted to.
38of the reacted event as its value. 35
36The reaction event MAY include a `k` tag with the stringified kind number of the reacted event as its value.
39 37
40Example code 38Example code
41 39
42```swift 40```swift
43func make_like_event(pubkey: String, privkey: String, liked: NostrEvent) -> NostrEvent { 41func make_like_event(pubkey: String, privkey: String, liked: NostrEvent) -> NostrEvent {
44 var tags: [[String]] = liked.tags.filter { 42 var tags: [[String]] = liked.tags.filter {
45 tag in tag.count >= 2 && (tag[0] == "e" || tag[0] == "p") 43 tag in tag.count >= 2 && (tag[0] == "e" || tag[0] == "p")
46 } 44 }
47 tags.append(["e", liked.id]) 45 tags.append(["e", liked.id])
48 tags.append(["p", liked.pubkey]) 46 tags.append(["p", liked.pubkey])
@@ -68,8 +66,7 @@ content as an emoji if shortcode is specified.
68 "tags": [ 66 "tags": [
69 ["emoji", "soapbox", "https://gleasonator.com/emoji/Gleasonator/soapbox.png"] 67 ["emoji", "soapbox", "https://gleasonator.com/emoji/Gleasonator/soapbox.png"]
70 ], 68 ],
71 "pubkey": "79c2cae114ea28a981e7559b4fe7854a473521a8d22a66bbab9fa248eb820ff6", 69 ...other fields
72 "created_at": 1682790000
73} 70}
74``` 71```
75 72