Move isLocallyFollowed to queries.ts

This commit is contained in:
Alex Gleason
2023-08-17 19:32:05 -05:00
parent 2011ca6e1d
commit dc49c305bd
3 changed files with 12 additions and 17 deletions

View File

@@ -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 } from '@/deps.ts';
import { isLocallyFollowed } from '@/queries.ts';
import { trends } from '@/trends.ts';
import { isRelay, nostrDate } from '@/utils.ts';
@@ -19,7 +20,7 @@ async function handleEvent(event: Event): Promise<void> {
/** Maybe store the event, if eligible. */
async function storeEvent(event: Event): Promise<void> {
if (await findUser({ pubkey: event.pubkey }) || await eventsDB.isLocallyFollowed(event.pubkey)) {
if (await findUser({ pubkey: event.pubkey }) || await isLocallyFollowed(event.pubkey)) {
await eventsDB.insertEvent(event).catch(console.warn);
}
}