Skip to content

Commit

Permalink
Simplifying reactions
Browse files Browse the repository at this point in the history
  • Loading branch information
vitorpamplona committed May 4, 2024
1 parent dcb5d0f commit 3834c6b
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions 25.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,13 @@ consider it a "+".
Tags
----

The reaction event SHOULD include `e` and `p` tags from the note the user is
reacting to. 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.
The reaction event SHOULD include `e` and `p` tags pointing to the note the user is
reacting to. The `p` tag allows authors to be notified. The `e` tags enables clients
to pull all the reactions to individual posts.

The last `e` tag MUST be the `id` of the note that is being reacted to.
The `e` tag MUST be the `id` of the note that is being reacted to.

The last `p` tag MUST be the `pubkey` of the event being reacted to.
The `p` tag MUST be the `pubkey` of the event being reacted to.

The reaction event MAY include a `k` tag with the stringified kind number
of the reacted event as its value.
Expand All @@ -41,9 +40,6 @@ Example code

```swift
func make_like_event(pubkey: String, privkey: String, liked: NostrEvent) -> NostrEvent {
var tags: [[String]] = liked.tags.filter {
tag in tag.count >= 2 && (tag[0] == "e" || tag[0] == "p")
}
tags.append(["e", liked.id])
tags.append(["p", liked.pubkey])
tags.append(["k", liked.kind])
Expand Down

2 comments on commit 3834c6b

@jb55
Copy link
Contributor

@jb55 jb55 commented on 3834c6b Jun 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the point of multiple e tags was to allow fetching all notes in a thread nip10-style. multiple p-tags enables "bob liked a post you were mentioned in"

this change is wrong. please revert it, as it is causing confusion:

also maybe ping the original author of the NIP before you drastically change it? @fiatjaf @vitorpamplona

@vitorpamplona
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can see the PR here #1221

The issue is that just reverting it won't do what you want it to do. Replies don't include the full branch of e-tags anymore, just "root" and "reply" and a random assortment of e-tags from old clients. So, just copying the e-tags doesn't make any sense.

If you want to "fetch all notes in a thread nip10-style" then we can change the NIP to get signers to reassemble the thread before liking the content so that they can cite all e-tags of the branch. Without that, the e-tags make little sense.

It's similar to p-tags. There is no way to blindly predict what each p-tag was about in the reply like the original content was suggesting.

I am not against adding p-tags to notify people, but those should be remapped to use a different tag name (like the q) to make sure queries are done right or include a custom marker as NIP-10 requests.

Please sign in to comment.