Merge pull request #11 from v0l/reactions

feat: add support for positive and negative reactions
This commit is contained in:
2023-01-07 11:12:49 +00:00
committed by GitHub
2 changed files with 43 additions and 5 deletions

View File

@ -83,10 +83,10 @@ export default function useEventPublisher() {
}
return await signEvent(ev);
},
like: async (evRef) => {
like: async (evRef, content = "+") => {
let ev = Event.ForPubKey(pubKey);
ev.Kind = EventKind.Reaction;
ev.Content = "+";
ev.Content = content;
ev.Tags.push(new Tag(["e", evRef.Id], 0));
ev.Tags.push(new Tag(["p", evRef.PubKey], 1));
return await signEvent(ev);