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:
parent
6a0affcec1
commit
13f69e4291
|
@ -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
|
||||
};
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue