diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2023-10-11 17:29:24 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2023-10-11 17:29:24 +0900 |
| commit | a26d9ea132f3a8a48109083f014abc377614d719 (patch) | |
| tree | e9d00e0ab4194c5d9b1907a70a0aec04b7f9958f /packages/backend/src/server/api/endpoints/notes/local-timeline.ts | |
| parent | update test (diff) | |
| download | sharkey-a26d9ea132f3a8a48109083f014abc377614d719.tar.gz sharkey-a26d9ea132f3a8a48109083f014abc377614d719.tar.bz2 sharkey-a26d9ea132f3a8a48109083f014abc377614d719.zip | |
enhance(backend): LTLでフォローしているユーザーからの自分への返信が含まれるように
Diffstat (limited to 'packages/backend/src/server/api/endpoints/notes/local-timeline.ts')
| -rw-r--r-- | packages/backend/src/server/api/endpoints/notes/local-timeline.ts | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/packages/backend/src/server/api/endpoints/notes/local-timeline.ts b/packages/backend/src/server/api/endpoints/notes/local-timeline.ts index 55b5d47386..d10c3bedbf 100644 --- a/packages/backend/src/server/api/endpoints/notes/local-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/local-timeline.ts @@ -95,15 +95,13 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint- if (ps.withFiles) { noteIds = await this.redisTimelineService.get('localTimelineWithFiles', untilId, sinceId); - } else if (ps.withReplies) { + } else { const [nonReplyNoteIds, replyNoteIds] = await this.redisTimelineService.getMulti([ 'localTimeline', 'localTimelineWithReplies', ], untilId, sinceId); noteIds = Array.from(new Set([...nonReplyNoteIds, ...replyNoteIds])); noteIds.sort((a, b) => a > b ? -1 : 1); - } else { - noteIds = await this.redisTimelineService.get('localTimeline', untilId, sinceId); } noteIds = noteIds.slice(0, ps.limit); @@ -127,6 +125,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint- if (me && (note.userId === me.id)) { return true; } + if (!ps.withReplies && note.replyId && (me == null || note.replyUserId !== me.id)) return false; if (me && isUserRelated(note, userIdsWhoBlockingMe)) return false; if (me && isUserRelated(note, userIdsWhoMeMuting)) return false; if (note.renoteId) { |