From 9b66499df3508d39c52a2404cb8454ed33f807a2 Mon Sep 17 00:00:00 2001 From: "P. Reis" Date: Mon, 16 Sep 2024 14:00:12 -0300 Subject: [PATCH] fix: get zap recipient in gatherAuthors() function this is needed to work correctly in notifications --- src/storages/hydrate.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/storages/hydrate.ts b/src/storages/hydrate.ts index e2f69e18..2de49cb3 100644 --- a/src/storages/hydrate.ts +++ b/src/storages/hydrate.ts @@ -230,7 +230,13 @@ function gatherQuotes({ events, store, signal }: HydrateOpts): Promise { - const pubkeys = new Set(events.map((event) => event.pubkey)); + const pubkeys = new Set(events.map((event) => { + if (event.kind === 9735) { + const pubkey = event.tags.find(([name]) => name === 'p')?.[1]; + if (pubkey) return pubkey; + } + return event.pubkey; + })); return store.query( [{ kinds: [0], authors: [...pubkeys], limit: pubkeys.size }],