Skip to content

Commit 58e94b2

Browse files
committed
Revert "Simplifying reactions"
This reverts commit 3834c6b. see nostrability/nostrability#48
1 parent ff2e05d commit 58e94b2

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

25.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,23 @@ consider it a "+".
2525
Tags
2626
----
2727

28-
The reaction event SHOULD include `a`, `e` and `p` tags pointing to the note the user is
29-
reacting to. The `p` tag allows authors to be notified. The `e` tags enables clients
30-
to pull all the reactions to individual events and `a` tags enables clients to seek reactions
31-
for all versions of a replaceable event.
28+
The 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.
3229

33-
The `e` tag MUST be the `id` of the note that is being reacted to.
30+
The last `e` tag MUST be the `id` of the note that is being reacted to.
3431

35-
The `a` tag MUST contain the coordinates (`kind:pubkey:d-tag`) of the replaceable being reacted to.
32+
The last `p` tag MUST be the `pubkey` of the event being reacted to.
3633

37-
The `p` tag MUST be the `pubkey` of the event being reacted to.
34+
The `a` tag MUST contain the coordinates (`kind:pubkey:d-tag`) of the replaceable being reacted to.
3835

39-
The reaction event MAY include a `k` tag with the stringified kind number
40-
of the reacted event as its value.
36+
The reaction event MAY include a `k` tag with the stringified kind number of the reacted event as its value.
4137

4238
Example code
4339

4440
```swift
4541
func 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+
}
4645
tags.append(["e", liked.id])
4746
tags.append(["p", liked.pubkey])
4847
tags.append(["k", liked.kind])

0 commit comments

Comments
 (0)