From 22e79675ad0bb8722864ceb683a260addb909f9d Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 16 Aug 2018 23:59:22 +0900 Subject: #2263 --- src/server/api/endpoints/notes/timeline.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/server/api/endpoints/notes/timeline.ts') diff --git a/src/server/api/endpoints/notes/timeline.ts b/src/server/api/endpoints/notes/timeline.ts index c1b8644e4d..3e3fa8c4aa 100644 --- a/src/server/api/endpoints/notes/timeline.ts +++ b/src/server/api/endpoints/notes/timeline.ts @@ -60,6 +60,13 @@ export const meta = { } }), + includeLocalRenotes: $.bool.optional.note({ + default: true, + desc: { + ja: 'Renoteされたローカルの投稿を含めるかどうか' + } + }), + mediaOnly: $.bool.optional.note({ desc: { ja: 'true にすると、メディアが添付された投稿だけ取得します' @@ -170,6 +177,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: [] } -- cgit v1.2.3-freya