summaryrefslogtreecommitdiff
path: root/packages/backend/src
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2024-05-11 14:21:17 +0100
committerdakkar <dakkar@thenautilus.net>2024-05-11 14:21:17 +0100
commit4e28004d0edb71ea620a17af318d1789d7164eac (patch)
tree14fb41aa16f3434e083f05248032275e2e38b83b /packages/backend/src
parentMerge remote-tracking branch 'misskey/release/2024.5.0' into future-2024-04-2... (diff)
downloadsharkey-4e28004d0edb71ea620a17af318d1789d7164eac.tar.gz
sharkey-4e28004d0edb71ea620a17af318d1789d7164eac.tar.bz2
sharkey-4e28004d0edb71ea620a17af318d1789d7164eac.zip
copy changes from createNote to updateNote
Diffstat (limited to 'packages/backend/src')
-rw-r--r--packages/backend/src/core/activitypub/models/ApNoteService.ts16
1 files changed, 7 insertions, 9 deletions
diff --git a/packages/backend/src/core/activitypub/models/ApNoteService.ts b/packages/backend/src/core/activitypub/models/ApNoteService.ts
index e70957eb61..542bb9e2e5 100644
--- a/packages/backend/src/core/activitypub/models/ApNoteService.ts
+++ b/packages/backend/src/core/activitypub/models/ApNoteService.ts
@@ -438,15 +438,13 @@ export class ApNoteService {
}
// 添付ファイル
- // TODO: attachmentは必ずしもImageではない
- // TODO: attachmentは必ずしも配列ではない
- const limit = promiseLimit<MiDriveFile>(2);
- const files = (await Promise.all(toArray(note.attachment).map(attach => (
- limit(() => this.apImageService.resolveImage(actor, {
- ...attach,
- sensitive: note.sensitive, // Noteがsensitiveなら添付もsensitiveにする
- }))
- ))));
+ const files: MiDriveFile[] = [];
+
+ for (const attach of toArray(note.attachment)) {
+ attach.sensitive ??= note.sensitive;
+ const file = await this.apImageService.resolveImage(actor, attach);
+ if (file) files.push(file);
+ }
// リプライ
const reply: MiNote | null = note.inReplyTo