fix(handleZaps): reject all kinds but 9735

This commit is contained in:
P. Reis 2024-06-23 23:51:10 -03:00
parent e1ee3bd8e9
commit fdb720386d

View file

@ -228,6 +228,8 @@ async function generateSetEvents(event: NostrEvent): Promise<void> {
/** Stores the event in the 'event_zaps' table */
async function handleZaps(kysely: Kysely<DittoTables>, event: NostrEvent) {
if (event.kind !== 9735) return;
const zapRequestString = event?.tags?.find(([name]) => name === 'description')?.[1];
if (!zapRequestString) return;
const zapRequest = n.json().pipe(n.event()).optional().catch(undefined).parse(zapRequestString);