From 1a9e771f26e6ea73ffb409962192522d9b010f24 Mon Sep 17 00:00:00 2001 From: Paul Miller Date: Wed, 15 Nov 2023 14:51:07 -0600 Subject: [PATCH] only submit follow "pubkeys" that are pubkeys --- src/utils/fetchZaps.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/utils/fetchZaps.ts b/src/utils/fetchZaps.ts index 223f78c..c3ac18a 100644 --- a/src/utils/fetchZaps.ts +++ b/src/utils/fetchZaps.ts @@ -143,12 +143,16 @@ async function fetchFollows(npub: string): Promise { const data = await response.json(); const follows: string[] = []; + const pubkeyRegex = new RegExp(/[0-9a-fA-F]{64}/); for (const event of data) { if (event.kind === 3) { for (const tag of event.tags) { if (tag[0] === "p") { - follows.push(tag[1]); + // make sure it's actually a pubkey + if (pubkeyRegex.test(tag[1])) { + follows.push(tag[1]); + } } } }