From 1b2a486c659d23877af46a115c8b4d826f14e418 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 26 Aug 2023 13:40:10 -0500 Subject: [PATCH] pipeline: don't store ephemeral events --- src/pipeline.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pipeline.ts b/src/pipeline.ts index e1a9c3a..14a364a 100644 --- a/src/pipeline.ts +++ b/src/pipeline.ts @@ -2,6 +2,7 @@ import * as eventsDB from '@/db/events.ts'; import { addRelays } from '@/db/relays.ts'; import { findUser } from '@/db/users.ts'; import { type Event, LRUCache } from '@/deps.ts'; +import { isEphemeralKind } from '@/kinds.ts'; import { isLocallyFollowed } from '@/queries.ts'; import { Sub } from '@/subs.ts'; import { trends } from '@/trends.ts'; @@ -43,6 +44,7 @@ async function getEventData({ pubkey }: Event): Promise { /** Maybe store the event, if eligible. */ async function storeEvent(event: Event, data: EventData): Promise { + if (isEphemeralKind(event.kind)) return; if (data.user || await isLocallyFollowed(event.pubkey)) { await eventsDB.insertEvent(event).catch(console.warn); } else {