forked from FoundKeyGang/FoundKey
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
3 changed files with 5 additions and 11 deletions
|
@ -158,7 +158,7 @@ export default async function renderNote(note: Note, dive = true): Promise<any>
|
||||||
cc,
|
cc,
|
||||||
inReplyTo,
|
inReplyTo,
|
||||||
attachment: files.map(renderDocument),
|
attachment: files.map(renderDocument),
|
||||||
sensitive: files.some(file => file.isSensitive),
|
sensitive: note.cw != null || files.some(file => file.isSensitive),
|
||||||
tag,
|
tag,
|
||||||
...asPoll
|
...asPoll
|
||||||
};
|
};
|
||||||
|
|
|
@ -112,12 +112,8 @@ export default define(meta, async (ps, user) => {
|
||||||
}));
|
}));
|
||||||
|
|
||||||
if (ps.excludeNsfw) {
|
if (ps.excludeNsfw) {
|
||||||
// v11 TODO
|
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)');
|
||||||
query['_files.isSensitive'] = {
|
|
||||||
$ne: true
|
|
||||||
};
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
|
@ -150,10 +150,8 @@ export default define(meta, async (ps, me) => {
|
||||||
}));
|
}));
|
||||||
|
|
||||||
if (ps.excludeNsfw) {
|
if (ps.excludeNsfw) {
|
||||||
// v11 TODO
|
query.andWhere('note.cw IS NULL');
|
||||||
/*query['_files.isSensitive'] = {
|
query.andWhere('0 = (SELECT COUNT(*) FROM drive_file df WHERE df.id = ANY(note."fileIds") AND df."isSensitive" = TRUE)');
|
||||||
$ne: true
|
|
||||||
};*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue