This commit is contained in:
syuilo 2018-08-16 23:59:22 +09:00
parent 7f9a35d7ac
commit 22e79675ad
16 changed files with 205 additions and 66 deletions

View file

@ -59,6 +59,13 @@ export const meta = {
}
}),
includeLocalRenotes: $.bool.optional.note({
default: true,
desc: {
ja: 'Renoteされたローカルの投稿を含めるかどうか'
}
}),
mediaOnly: $.bool.optional.note({
desc: {
ja: 'true にすると、メディアが添付された投稿だけ取得します'
@ -180,6 +187,22 @@ export default async (params: any, user: ILocalUser) => {
});
}
if (ps.includeLocalRenotes === false) {
query.$and.push({
$or: [{
'_renote.user.host': { $ne: null }
}, {
renoteId: null
}, {
text: { $ne: null }
}, {
mediaIds: { $ne: [] }
}, {
poll: { $ne: null }
}]
});
}
if (ps.mediaOnly) {
query.$and.push({
mediaIds: { $exists: true, $ne: [] }