From 44d525eccbd218a459e150d8376424d25e77f7ae Mon Sep 17 00:00:00 2001 From: "P. Reis" Date: Mon, 3 Mar 2025 21:17:17 -0300 Subject: [PATCH] fix: use author pubkey, not admin pubkey --- packages/ditto/storages/DittoRelayStore.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/ditto/storages/DittoRelayStore.ts b/packages/ditto/storages/DittoRelayStore.ts index de09d684..54dc2279 100644 --- a/packages/ditto/storages/DittoRelayStore.ts +++ b/packages/ditto/storages/DittoRelayStore.ts @@ -42,7 +42,6 @@ import { parseNoteContent, stripimeta } from '@/utils/note.ts'; import { SimpleLRU } from '@/utils/SimpleLRU.ts'; import { unfurlCardCached } from '@/utils/unfurl.ts'; import { renderWebPushNotification } from '@/views/mastodon/push.ts'; -import { refreshAuthorStats } from '@/utils/stats.ts'; interface DittoRelayStoreOpts { db: DittoDB; @@ -122,7 +121,7 @@ export class DittoRelayStore implements NRelay { * It is idempotent, so it can be called multiple times for the same event. */ async event(event: DittoEvent, opts: { publish?: boolean; signal?: AbortSignal } = {}): Promise { - const { conf, relay, db } = this.opts; + const { conf, relay } = this.opts; const { signal } = opts; // Skip events that have already been encountered. @@ -188,7 +187,7 @@ export class DittoRelayStore implements NRelay { } finally { // This needs to run in steps, and should not block the API from responding. Promise.allSettled([ - await this.handleRevokeNip05(event, signal), + this.handleRevokeNip05(event, signal), this.handleZaps(event), this.updateAuthorData(event, signal), this.prewarmLinkPreview(event, signal), @@ -271,7 +270,7 @@ export class DittoRelayStore implements NRelay { await db.kysely.insertInto('author_stats') .values({ - pubkey: event.pubkey, + pubkey: author.pubkey, followers_count: 0, following_count: 0, notes_count: 0,