excludeNsfwやCWのNSFW扱いなど (#5341)

* NoteにisSensitive

* Revert "NoteにisSensitive"

This reverts commit 3d5bcfbaf0.

* query excludeNsfw

* AP deliverでCW付きはsensitiveにするように

* excludeNsfwでCW付きも除くように
This commit is contained in:
MeiMei 2019-08-27 17:33:07 +09:00 committed by Acid Chicken (硫酸鶏)
parent 6a0affcec1
commit 13f69e4291
3 changed files with 5 additions and 11 deletions

View File

@ -158,7 +158,7 @@ export default async function renderNote(note: Note, dive = true): Promise<any>
cc,
inReplyTo,
attachment: files.map(renderDocument),
sensitive: files.some(file => file.isSensitive),
sensitive: note.cw != null || files.some(file => file.isSensitive),
tag,
...asPoll
};

View File

@ -112,12 +112,8 @@ export default define(meta, async (ps, user) => {
}));
if (ps.excludeNsfw) {
// v11 TODO
/*
query['_files.isSensitive'] = {
$ne: true
};
*/
query.andWhere('note.cw IS NULL');
query.andWhere('0 = (SELECT COUNT(*) FROM drive_file df WHERE df.id = ANY(note."fileIds") AND df."isSensitive" = TRUE)');
}
}
//#endregion

View File

@ -150,10 +150,8 @@ export default define(meta, async (ps, me) => {
}));
if (ps.excludeNsfw) {
// v11 TODO
/*query['_files.isSensitive'] = {
$ne: true
};*/
query.andWhere('note.cw IS NULL');
query.andWhere('0 = (SELECT COUNT(*) FROM drive_file df WHERE df.id = ANY(note."fileIds") AND df."isSensitive" = TRUE)');
}
}