mirror of
https://github.com/hotomoe/hotomoe
synced 2024-12-02 00:38:14 +09:00
excludeNsfwやCWのNSFW扱いなど (#5341)
* NoteにisSensitive * Revert "NoteにisSensitive" This reverts commit 3d5bcfbaf078ff91257a508f817dd1ef4ea31d7b. * 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 New Issue
Block a user