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:
authorVitor Pamplona <vitor@vitorpamplona.com>2024-05-30 15:32:46 -0400
committerVitor Pamplona <vitor@vitorpamplona.com>2024-05-30 15:32:46 -0400
commitd5b77b6d7348061cd0f16adc35e4d02a3a0b7380 (patch)
treef00539ec0e0a8b6bf027ff6a9b93846adafa02b3 /25.md
parent48674e563865b1cb7bb3c5c7869d20055446f408 (diff)
parent5c796c19fd6330628a0b328bfcf5270cb2bc3aff (diff)
Merge remote-tracking branch 'upstream/master' into draft-event
# Conflicts: # README.md
Diffstat (limited to '25.md')
-rw-r--r--25.md20
1 files changed, 9 insertions, 11 deletions
diff --git a/25.md b/25.md
index 3b4aa59..698f3fb 100644
--- a/25.md
+++ b/25.md
@@ -25,14 +25,16 @@ 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 `a`, `e` and `p` tags pointing to the note the user is
29reacting to. This allows users to be notified of reactions to posts they were 29reacting to. The `p` tag allows authors to be notified. The `e` tags enables clients
30mentioned in. Including the `e` tags enables clients to pull all the reactions 30to pull all the reactions to individual events and `a` tags enables clients to seek reactions
31associated with individual posts or all the posts in a thread. 31for all versions of a replaceable event.
32 32
33The last `e` tag MUST be the `id` of the note that is being reacted to. 33The `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 `a` tag MUST contain the coordinates (`kind:pubkey:d-tag`) of the replaceable being reacted to.
36
37The `p` tag MUST be the `pubkey` of the event being reacted to.
36 38
37The reaction event MAY include a `k` tag with the stringified kind number 39The reaction event MAY include a `k` tag with the stringified kind number
38of the reacted event as its value. 40of the reacted event as its value.
@@ -41,9 +43,6 @@ Example code
41 43
42```swift 44```swift
43func make_like_event(pubkey: String, privkey: String, liked: NostrEvent) -> NostrEvent { 45func make_like_event(pubkey: String, privkey: String, liked: NostrEvent) -> NostrEvent {
44 var tags: [[String]] = liked.tags.filter {
45 tag in tag.count >= 2 && (tag[0] == "e" || tag[0] == "p")
46 }
47 tags.append(["e", liked.id]) 46 tags.append(["e", liked.id])
48 tags.append(["p", liked.pubkey]) 47 tags.append(["p", liked.pubkey])
49 tags.append(["k", liked.kind]) 48 tags.append(["k", liked.kind])
@@ -68,8 +67,7 @@ content as an emoji if shortcode is specified.
68 "tags": [ 67 "tags": [
69 ["emoji", "soapbox", "https://gleasonator.com/emoji/Gleasonator/soapbox.png"] 68 ["emoji", "soapbox", "https://gleasonator.com/emoji/Gleasonator/soapbox.png"]
70 ], 69 ],
71 "pubkey": "79c2cae114ea28a981e7559b4fe7854a473521a8d22a66bbab9fa248eb820ff6", 70 ...other fields
72 "created_at": 1682790000
73} 71}
74``` 72```
75 73