diff options
| author | MeiMei <30769358+mei23@users.noreply.github.com> | 2019-01-29 17:34:43 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2019-01-29 17:34:43 +0900 |
| commit | 2ed9e26a4fc6ece9b510538ac6c48a62eb8536d1 (patch) | |
| tree | bbefc668c1b611d1ad083bf7fed49381ed70ce14 /src/server/api/endpoints/notes/replies.ts | |
| parent | Sort tasks by topological ordering (diff) | |
| download | sharkey-2ed9e26a4fc6ece9b510538ac6c48a62eb8536d1.tar.gz sharkey-2ed9e26a4fc6ece9b510538ac6c48a62eb8536d1.tar.bz2 sharkey-2ed9e26a4fc6ece9b510538ac6c48a62eb8536d1.zip | |
リプライ/メンションされていれば非フォロワーへのフォロワー限定でも参照可能に (#4033)
* 非メンション/リプライ投稿がmentionsにあるかどうかはvisibilityと関係ないので削除
* リプライ/メンションされていれば非フォロワーでも参照可能に
Diffstat (limited to 'src/server/api/endpoints/notes/replies.ts')
| -rw-r--r-- | src/server/api/endpoints/notes/replies.ts | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/server/api/endpoints/notes/replies.ts b/src/server/api/endpoints/notes/replies.ts index 112156403d..199139c8e5 100644 --- a/src/server/api/endpoints/notes/replies.ts +++ b/src/server/api/endpoints/notes/replies.ts @@ -51,14 +51,23 @@ export default define(meta, (ps, user) => new Promise(async (res, rej) => { }] : [{ visibility: { $in: [ 'public', 'home' ] } }, { - // myself (for specified/private) + // myself (for followers/specified/private) userId: user._id }, { // to me (for specified) visibleUserIds: { $in: [ user._id ] } }, { visibility: 'followers', - userId: { $in: followings.map(f => f.id) } + $or: [{ + // フォロワーの投稿 + userId: { $in: followings.map(f => f.id) }, + }, { + // 自分の投稿へのリプライ + '_reply.userId': user._id, + }, { + // 自分へのメンションが含まれている + mentions: { $in: [ user._id ] } + }] }]; const q = { |