diff --git a/src/pipeline.ts b/src/pipeline.ts index c086c92..7da026f 100644 --- a/src/pipeline.ts +++ b/src/pipeline.ts @@ -1,5 +1,6 @@ import { NostrEvent, NSchema as n } from '@nostrify/nostrify'; import { LNURL } from '@nostrify/nostrify/ln'; +import { PipePolicy } from '@nostrify/nostrify/policies'; import Debug from '@soapbox/stickynotes/debug'; import { sql } from 'kysely'; @@ -33,9 +34,12 @@ async function handleEvent(event: DittoEvent, signal: AbortSignal): Promise ${event.id}`); - await hydrateEvent(event, signal); - await policyFilter(event); + if (event.kind !== 24133) { + await policyFilter(event); + } + + await hydrateEvent(event, signal); await Promise.all([ storeEvent(event, signal), @@ -51,9 +55,12 @@ async function handleEvent(event: DittoEvent, signal: AbortSignal): Promise { - const policy = new MuteListPolicy(Conf.pubkey, Storages.admin); - const result = await policy.call(event); + const policy = new PipePolicy([ + new MuteListPolicy(Conf.pubkey, Storages.admin), + // put custom policy here + ]); + const result = await policy.call(event); debug(JSON.stringify(result)); const [_, _eventId, ok, reason] = result;