diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-08-16 23:59:22 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-08-16 23:59:22 +0900 |
| commit | 22e79675ad0bb8722864ceb683a260addb909f9d (patch) | |
| tree | 19ae7c4cc3649bac7abf2d73b25a3731beb66c18 /src/server/api/endpoints/notes/timeline.ts | |
| parent | Improve object storage key (diff) | |
| download | sharkey-22e79675ad0bb8722864ceb683a260addb909f9d.tar.gz sharkey-22e79675ad0bb8722864ceb683a260addb909f9d.tar.bz2 sharkey-22e79675ad0bb8722864ceb683a260addb909f9d.zip | |
#2263
Diffstat (limited to 'src/server/api/endpoints/notes/timeline.ts')
| -rw-r--r-- | src/server/api/endpoints/notes/timeline.ts | 23 |
1 files changed, 23 insertions, 0 deletions
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: [] } |