diff options
| author | MeiMei <30769358+mei23@users.noreply.github.com> | 2019-01-08 21:02:00 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2019-01-08 21:02:00 +0900 |
| commit | 04e1e48f1746533609372311becdd6800b005f50 (patch) | |
| tree | 7b81396e0907227c8af34688ad0262a2b20a472a /src/server/api/endpoints/notes/timeline.ts | |
| parent | :art: (diff) | |
| download | sharkey-04e1e48f1746533609372311becdd6800b005f50.tar.gz sharkey-04e1e48f1746533609372311becdd6800b005f50.tar.bz2 sharkey-04e1e48f1746533609372311becdd6800b005f50.zip | |
Hide invisible notes from timeline (#3852)
Diffstat (limited to 'src/server/api/endpoints/notes/timeline.ts')
| -rw-r--r-- | src/server/api/endpoints/notes/timeline.ts | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/server/api/endpoints/notes/timeline.ts b/src/server/api/endpoints/notes/timeline.ts index 3c970c03a1..5604cf291b 100644 --- a/src/server/api/endpoints/notes/timeline.ts +++ b/src/server/api/endpoints/notes/timeline.ts @@ -139,12 +139,29 @@ export default define(meta, (ps, user) => new Promise(async (res, rej) => { }] }); + const visibleQuery = user == null ? [{ + visibility: { $in: [ 'public', 'home' ] } + }] : [{ + visibility: { $in: [ 'public', 'home' ] } + }, { + // myself (for specified/private) + userId: user._id + }, { + // to me (for specified) + visibleUserIds: { $in: [ user._id ] } + }]; + const query = { $and: [{ deletedAt: null, - // フォローしている人の投稿 - $or: followQuery, + $and: [{ + // フォローしている人の投稿 + $or: followQuery + }, { + // visible for me + $or: visibleQuery + }], // mute userId: { |