Add includeRenotes and renotesOnly options to /api/users/notes

This commit is contained in:
Stefano Pigozzi 2023-07-09 08:56:27 +02:00
parent 3b56117fab
commit e9376cc65c

View file

@ -45,6 +45,8 @@ export const paramDef = {
untilId: { type: "string", format: "misskey:id" },
sinceDate: { type: "integer" },
untilDate: { type: "integer" },
includeRenotes: { type: "boolean", default: true },
renotesOnly: { type: "boolean", default: false },
includeMyRenotes: { type: "boolean", default: true },
withFiles: { type: "boolean", default: false },
fileType: {
@ -122,6 +124,14 @@ export default define(meta, paramDef, async (ps, me) => {
query.andWhere("note.replyId IS NULL");
}
if (!ps.includeRenotes) {
query.andWhere("note.renoteId IS NULL");
}
if (ps.renotesOnly) {
query.andWhere("note.renoteId IS NOT NULL");
}
if (ps.includeMyRenotes === false) {
query.andWhere(
new Brackets((qb) => {