mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-26 20:07:33 -07:00
commit
9dbf5c6df9
3 changed files with 7 additions and 1 deletions
|
@ -81,7 +81,9 @@ export async function createNote(value: any, resolver?: Resolver, silent = false
|
||||||
// 添付メディア
|
// 添付メディア
|
||||||
// TODO: attachmentは必ずしもImageではない
|
// TODO: attachmentは必ずしもImageではない
|
||||||
// TODO: attachmentは必ずしも配列ではない
|
// TODO: attachmentは必ずしも配列ではない
|
||||||
|
// Noteがsensitiveなら添付もsensitiveにする
|
||||||
const media = note.attachment
|
const media = note.attachment
|
||||||
|
.map(attach => attach.sensitive = note.sensitive)
|
||||||
? await Promise.all(note.attachment.map(x => resolveImage(actor, x)))
|
? await Promise.all(note.attachment.map(x => resolveImage(actor, x)))
|
||||||
: [];
|
: [];
|
||||||
|
|
||||||
|
|
|
@ -79,6 +79,8 @@ export default async function renderNote(note: INote, dive = true): Promise<any>
|
||||||
...mentionTags,
|
...mentionTags,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const files = await promisedFiles;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
id: `${config.url}/notes/${note._id}`,
|
id: `${config.url}/notes/${note._id}`,
|
||||||
type: 'Note',
|
type: 'Note',
|
||||||
|
@ -89,7 +91,8 @@ export default async function renderNote(note: INote, dive = true): Promise<any>
|
||||||
to,
|
to,
|
||||||
cc,
|
cc,
|
||||||
inReplyTo,
|
inReplyTo,
|
||||||
attachment: (await promisedFiles).map(renderDocument),
|
attachment: files.map(renderDocument),
|
||||||
|
sensitive: files.some(file => file.metadata.isSensitive),
|
||||||
tag
|
tag
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,7 @@ export interface IObject {
|
||||||
image?: any;
|
image?: any;
|
||||||
url?: string;
|
url?: string;
|
||||||
tag?: any[];
|
tag?: any[];
|
||||||
|
sensitive?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IActivity extends IObject {
|
export interface IActivity extends IObject {
|
||||||
|
|
Loading…
Reference in a new issue