copy changes from createNote to updateNote

This commit is contained in:
dakkar 2024-05-11 14:21:17 +01:00
parent 451b0ecc9b
commit 4e28004d0e

View file

@ -438,15 +438,13 @@ export class ApNoteService {
} }
// 添付ファイル // 添付ファイル
// TODO: attachmentは必ずしもImageではない const files: MiDriveFile[] = [];
// TODO: attachmentは必ずしも配列ではない
const limit = promiseLimit<MiDriveFile>(2); for (const attach of toArray(note.attachment)) {
const files = (await Promise.all(toArray(note.attachment).map(attach => ( attach.sensitive ??= note.sensitive;
limit(() => this.apImageService.resolveImage(actor, { const file = await this.apImageService.resolveImage(actor, attach);
...attach, if (file) files.push(file);
sensitive: note.sensitive, // Noteがsensitiveなら添付もsensitiveにする }
}))
))));
// リプライ // リプライ
const reply: MiNote | null = note.inReplyTo const reply: MiNote | null = note.inReplyTo