Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please add an option to disable generateTags() #53

Open
oren-z0 opened this issue Jul 15, 2023 · 1 comment
Open

Please add an option to disable generateTags() #53

oren-z0 opened this issue Jul 15, 2023 · 1 comment

Comments

@oren-z0
Copy link

oren-z0 commented Jul 15, 2023

I wanted to publish a note that mentions another note without it appearing as a reply to that note.

When Damus does it (by clicking the repost button and then choosing "Quote" to add text), it adds a q tag instead of an e tag.

When I tried to mimic this behavior, the generateTags() function analyzed the event content and added an e tag that I didn't want - and the note appeared as a reply (and also on the profile page it appeared in the "Notes & Replires" tab instead of the "Notes" tab).

Also, generateTags() is called multiple times from lots of places in the code - so I didn't manage to use the class in a way that doesn't call it (and still manage to sign & publish the event).

I ended up overriding the function with: event.generateTags = () =>({ content: event.content, tags: event.tags }); which is really ugly. Would be nicer if I could do: event.disableTagGeneration = true or something similar.

P.S.
This library is awesome. I used it to build this bot: https://damus.io/npub1qm05ghrt2xuc970rxpsuchs504ah4rllxsgevdyjc0v5uha77m6qujz78x

@oren-z0
Copy link
Author

oren-z0 commented Jul 17, 2023

generateTags() also adds p tags to zap request events, which is not allowed:
https://github.com/nostr-protocol/nips/blob/master/57.md#appendix-d-lnurl-server-zap-request-validation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant