From ee41972b22857d1cef6355c274679af8348a879e Mon Sep 17 00:00:00 2001 From: fly_mc Date: Wed, 27 Nov 2024 13:07:05 +0800 Subject: [PATCH] Revert "pass resolver when creating notes via side-effect" This reverts commit 9da0739277cda26d2af79432d3ab0dbd1495da38. --- packages/backend/src/core/activitypub/ApInboxService.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/backend/src/core/activitypub/ApInboxService.ts b/packages/backend/src/core/activitypub/ApInboxService.ts index 3cf721366..87a3c8937 100644 --- a/packages/backend/src/core/activitypub/ApInboxService.ts +++ b/packages/backend/src/core/activitypub/ApInboxService.ts @@ -164,7 +164,7 @@ export class ApInboxService { } else if (isAnnounce(activity)) { return await this.announce(actor, activity, resolver); } else if (isLike(activity)) { - return await this.like(actor, activity, resolver); + return await this.like(actor, activity); } else if (isUndo(activity)) { return await this.undo(actor, activity, resolver); } else if (isBlock(activity)) { @@ -196,13 +196,10 @@ export class ApInboxService { } @bindThis - private async like(actor: MiRemoteUser, activity: ILike, resolver?: Resolver): Promise { + private async like(actor: MiRemoteUser, activity: ILike): Promise { const targetUri = getApId(activity.object); - const object = fromTuple(activity.object); - if (!object) return 'skip: activity has no object property'; - - const note = await this.apNoteService.resolveNote(object, { resolver }); + const note = await this.apNoteService.fetchNote(targetUri); if (!note) return `skip: target note not found ${targetUri}`; await this.apNoteService.extractEmojis(activity.tag ?? [], actor.host).catch(() => null);