upleb.uk

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

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitor Pamplona <vitor@vitorpamplona.com>2024-05-04 16:10:13 -0400
committerVitor Pamplona <vitor@vitorpamplona.com>2024-05-04 16:10:13 -0400
commit3834c6b60474a677b53847743212df27710e64ec (patch)
tree5ac2d316473c073bd3fb194c50cd81aa7fbfb6db
parentdcb5d0f18d6b0c60bda9abc79c6cca99a4d86177 (diff)
Simplifying reactions
-rw-r--r--25.md14
1 files changed, 5 insertions, 9 deletions
diff --git a/25.md b/25.md
index 3b4aa59..bdee066 100644
--- a/25.md
+++ b/25.md
@@ -25,14 +25,13 @@ 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 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 posts.
31associated with individual posts or all the posts in a thread.
32 31
33The last `e` tag MUST be the `id` of the note that is being reacted to. 32The `e` tag MUST be the `id` of the note that is being reacted to.
34 33
35The last `p` tag MUST be the `pubkey` of the event being reacted to. 34The `p` tag MUST be the `pubkey` of the event being reacted to.
36 35
37The reaction event MAY include a `k` tag with the stringified kind number 36The reaction event MAY include a `k` tag with the stringified kind number
38of the reacted event as its value. 37of the reacted event as its value.
@@ -41,9 +40,6 @@ Example code
41 40
42```swift 41```swift
43func make_like_event(pubkey: String, privkey: String, liked: NostrEvent) -> NostrEvent { 42func 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]) 43 tags.append(["e", liked.id])
48 tags.append(["p", liked.pubkey]) 44 tags.append(["p", liked.pubkey])
49 tags.append(["k", liked.kind]) 45 tags.append(["k", liked.kind])