Revert "pass resolver when creating notes via side-effect"

This reverts commit 9da0739277.
This commit is contained in:
fly_mc 2024-11-27 13:07:05 +08:00
parent ce14b758b3
commit ee41972b22

View file

@ -164,7 +164,7 @@ export class ApInboxService {
} else if (isAnnounce(activity)) { } else if (isAnnounce(activity)) {
return await this.announce(actor, activity, resolver); return await this.announce(actor, activity, resolver);
} else if (isLike(activity)) { } else if (isLike(activity)) {
return await this.like(actor, activity, resolver); return await this.like(actor, activity);
} else if (isUndo(activity)) { } else if (isUndo(activity)) {
return await this.undo(actor, activity, resolver); return await this.undo(actor, activity, resolver);
} else if (isBlock(activity)) { } else if (isBlock(activity)) {
@ -196,13 +196,10 @@ export class ApInboxService {
} }
@bindThis @bindThis
private async like(actor: MiRemoteUser, activity: ILike, resolver?: Resolver): Promise<string> { private async like(actor: MiRemoteUser, activity: ILike): Promise<string> {
const targetUri = getApId(activity.object); const targetUri = getApId(activity.object);
const object = fromTuple(activity.object); const note = await this.apNoteService.fetchNote(targetUri);
if (!object) return 'skip: activity has no object property';
const note = await this.apNoteService.resolveNote(object, { resolver });
if (!note) return `skip: target note not found ${targetUri}`; if (!note) return `skip: target note not found ${targetUri}`;
await this.apNoteService.extractEmojis(activity.tag ?? [], actor.host).catch(() => null); await this.apNoteService.extractEmojis(activity.tag ?? [], actor.host).catch(() => null);