From 5e46efe60dc411e6702f5024dfcabe5535b693d1 Mon Sep 17 00:00:00 2001 From: Hazelnoot Date: Sat, 14 Jun 2025 19:44:46 -0400 Subject: [PATCH] remove duplicate attach.sensitive updates --- .../backend/src/core/activitypub/models/ApNoteService.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/backend/src/core/activitypub/models/ApNoteService.ts b/packages/backend/src/core/activitypub/models/ApNoteService.ts index 8282f766c3..fa98102116 100644 --- a/packages/backend/src/core/activitypub/models/ApNoteService.ts +++ b/packages/backend/src/core/activitypub/models/ApNoteService.ts @@ -719,7 +719,6 @@ export class ApNoteService { if (htmlContent) { for (const attach of extractMediaFromHtml(htmlContent)) { if (hasUrl(attach)) { - attach.sensitive ??= note.sensitive; attachments.set(attach.url, attach); } } @@ -744,7 +743,6 @@ export class ApNoteService { const icon = getBestIcon(note); if (icon) { if (hasUrl(icon)) { - icon.sensitive ??= note.sensitive; attachments.set(icon.url, icon); } } @@ -753,7 +751,6 @@ export class ApNoteService { // AP attachments should be considered canonical. for (const attach of toArray(note.attachment)) { if (hasUrl(attach)) { - attach.sensitive ??= note.sensitive; attachments.set(attach.url, attach); } } @@ -764,8 +761,10 @@ export class ApNoteService { const results = await Promise .all(Array .from(attachments.values()) - .map(attach => limiter(() => this - .resolveImage(actor, attach)))); + .map(attach => limiter(async () => { + attach.sensitive ??= note.sensitive; + return await this.resolveImage(actor, attach); + }))); // Process results let hasFileError = false;