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/users | |
| 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/users')
| -rw-r--r-- | src/server/api/endpoints/users/notes.ts | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/server/api/endpoints/users/notes.ts b/src/server/api/endpoints/users/notes.ts index ec2dab1290..6c336683ab 100644 --- a/src/server/api/endpoints/users/notes.ts +++ b/src/server/api/endpoints/users/notes.ts @@ -155,10 +155,23 @@ export default define(meta, (ps, me) => new Promise(async (res, rej) => { //#region Construct query const sort = { } as any; + const visibleQuery = me == null ? [{ + visibility: { $in: [ 'public', 'home' ] } + }] : [{ + visibility: { $in: [ 'public', 'home' ] } + }, { + // myself (for specified/private) + userId: me._id + }, { + // to me (for specified) + visibleUserIds: { $in: [ me._id ] } + }]; + const query = { $and: [ {} ], deletedAt: null, - userId: user._id + userId: user._id, + $or: visibleQuery } as any; if (ps.sinceId) { |