upleb.uk

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

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfiatjaf <fiatjaf@gmail.com>2024-06-06 08:57:35 -0300
committerfiatjaf <fiatjaf@gmail.com>2024-06-06 08:57:41 -0300
commit58e94b20ceb59326901415e2bdd678c51fab262b (patch)
tree78886785980e09df7c95271042aa5590982d36a8
parentff2e05d73fd7a4e4c373466a600abd532aac4879 (diff)
Revert "Simplifying reactions"
This reverts commit 3834c6b60474a677b53847743212df27710e64ec. see https://github.com/nostrability/nostrability/issues/48
-rw-r--r--25.md17
1 files changed, 8 insertions, 9 deletions
diff --git a/25.md b/25.md
index 698f3fb..17c203e 100644
--- a/25.md
+++ b/25.md
@@ -25,24 +25,23 @@ consider it a "+".
25Tags 25Tags
26---- 26----
27 27
28The reaction event SHOULD include `a`, `e` and `p` tags pointing to 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. The `p` tag allows authors to be notified. The `e` tags enables clients
30to pull all the reactions to individual events and `a` tags enables clients to seek reactions
31for all versions of a replaceable event.
32 29
33The `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 `a` tag MUST contain the coordinates (`kind:pubkey:d-tag`) of the replaceable being reacted to. 32The last `p` tag MUST be the `pubkey` of the event being reacted to.
36 33
37The `p` tag MUST be the `pubkey` of the event being reacted to. 34The `a` tag MUST contain the coordinates (`kind:pubkey:d-tag`) of the replaceable being reacted to.
38 35
39The 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 of the reacted event as its value.
40of the reacted event as its value.
41 37
42Example code 38Example code
43 39
44```swift 40```swift
45func make_like_event(pubkey: String, privkey: String, liked: NostrEvent) -> NostrEvent { 41func make_like_event(pubkey: String, privkey: String, liked: NostrEvent) -> NostrEvent {
42 var tags: [[String]] = liked.tags.filter {
43 tag in tag.count >= 2 && (tag[0] == "e" || tag[0] == "p")
44 }
46 tags.append(["e", liked.id]) 45 tags.append(["e", liked.id])
47 tags.append(["p", liked.pubkey]) 46 tags.append(["p", liked.pubkey])
48 tags.append(["k", liked.kind]) 47 tags.append(["k", liked.kind])