fetch target note of Like(Note) activities

This commit is contained in:
Hazelnoot 2024-11-03 16:41:47 -05:00
parent fd47bf3483
commit 47eb0daebb
1 changed files with 4 additions and 1 deletions

View File

@ -200,7 +200,10 @@ export class ApInboxService {
private async like(actor: MiRemoteUser, activity: ILike): Promise<string> { private async like(actor: MiRemoteUser, activity: ILike): Promise<string> {
const targetUri = getApId(activity.object); const targetUri = getApId(activity.object);
const note = await this.apNoteService.fetchNote(targetUri); const object = fromTuple(activity.object);
if (!object) return 'skip: activity has no object property';
const note = await this.apNoteService.resolveNote(object);
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);