Merge pull request #2348 from mei23/mei-0819-nsfw3

リモートにNSFWが効かないのを修正
This commit is contained in:
syuilo 2018-08-19 18:46:47 +09:00 committed by GitHub
commit 9bc3fcf74f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 1 deletions

View File

@ -81,7 +81,9 @@ export async function createNote(value: any, resolver?: Resolver, silent = false
// 添付メディア
// TODO: attachmentは必ずしもImageではない
// TODO: attachmentは必ずしも配列ではない
// Noteがsensitiveなら添付もsensitiveにする
const media = note.attachment
.map(attach => attach.sensitive = note.sensitive)
? await Promise.all(note.attachment.map(x => resolveImage(actor, x)))
: [];

View File

@ -79,6 +79,8 @@ export default async function renderNote(note: INote, dive = true): Promise<any>
...mentionTags,
];
const files = await promisedFiles;
return {
id: `${config.url}/notes/${note._id}`,
type: 'Note',
@ -89,7 +91,8 @@ export default async function renderNote(note: INote, dive = true): Promise<any>
to,
cc,
inReplyTo,
attachment: (await promisedFiles).map(renderDocument),
attachment: files.map(renderDocument),
sensitive: files.some(file => file.metadata.isSensitive),
tag
};
}

View File

@ -16,6 +16,7 @@ export interface IObject {
image?: any;
url?: string;
tag?: any[];
sensitive?: boolean;
}
export interface IActivity extends IObject {