From 9cd0a9bf226a592c8bf669e2104f9f7558c5b10a Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Mon, 9 Oct 2023 13:17:02 -0500 Subject: [PATCH] Stop querying the pool --- src/controllers/api/accounts.ts | 4 +--- src/queries.ts | 9 --------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/src/controllers/api/accounts.ts b/src/controllers/api/accounts.ts index 9ac9f57..68e28fd 100644 --- a/src/controllers/api/accounts.ts +++ b/src/controllers/api/accounts.ts @@ -3,7 +3,7 @@ import { Conf } from '@/config.ts'; import { insertUser } from '@/db/users.ts'; import { type Filter, findReplyTag, nip19, z } from '@/deps.ts'; import * as mixer from '@/mixer.ts'; -import { getAuthor, getFollowedPubkeys, getFollows, syncUser } from '@/queries.ts'; +import { getAuthor, getFollowedPubkeys, getFollows } from '@/queries.ts'; import { booleanParamSchema, fileSchema } from '@/schema.ts'; import { jsonMetaContentSchema } from '@/schemas/nostr.ts'; import { uploadFile } from '@/upload.ts'; @@ -58,8 +58,6 @@ const createAccountController: AppController = async (c) => { const verifyCredentialsController: AppController = async (c) => { const pubkey = c.get('pubkey')!; - await syncUser(pubkey); - const event = await getAuthor(pubkey); if (event) { return c.json(await renderAccount(event, { withSource: true })); diff --git a/src/queries.ts b/src/queries.ts index ff1b186..95bbaab 100644 --- a/src/queries.ts +++ b/src/queries.ts @@ -1,4 +1,3 @@ -import * as client from '@/client.ts'; import * as eventsDB from '@/db/events.ts'; import { type Event, type Filter, findReplyTag } from '@/deps.ts'; import * as mixer from '@/mixer.ts'; @@ -80,13 +79,6 @@ async function isLocallyFollowed(pubkey: string): Promise { return Boolean(event); } -/** Sync the user's state from other relays. */ -async function syncUser(pubkey: string): Promise { - await client.getFilters([ - { authors: [pubkey], kinds: [0, 3, 10000, 10001, 10002] }, - ], { timeout: 5000 }); -} - export { getAncestors, getAuthor, @@ -96,5 +88,4 @@ export { getFollowedPubkeys, getFollows, isLocallyFollowed, - syncUser, };