diff --git a/CHANGELOG-VRTL.md b/CHANGELOG-VRTL.md index 6a97758970be..2446537710c3 100644 --- a/CHANGELOG-VRTL.md +++ b/CHANGELOG-VRTL.md @@ -2,4 +2,5 @@ This file lists changes to VRTL Generic Branch. +- Fix replies to me are not included in V\[RS]TL if withReplies is disabled. - Add `vmimiRelayTimelineImplemented` and `disableVmimiRelayTimeline` to nodeinfo diff --git a/packages/backend/src/core/FanoutTimelineService.ts b/packages/backend/src/core/FanoutTimelineService.ts index 4edd4cf2a157..be3c968eeb67 100644 --- a/packages/backend/src/core/FanoutTimelineService.ts +++ b/packages/backend/src/core/FanoutTimelineService.ts @@ -42,6 +42,7 @@ export type FanoutTimelineName = | 'vmimiRelayTimeline' // replies are not included | 'vmimiRelayTimelineWithFiles' // only non-reply notes with files are included | 'vmimiRelayTimelineWithReplies' // only replies are included + | `vmimiRelayTimelineWithReplyTo:${string}` // Only replies to specific local user are included. Parameter is reply user id. @Injectable() export class FanoutTimelineService { diff --git a/packages/backend/src/core/NoteCreateService.ts b/packages/backend/src/core/NoteCreateService.ts index 0e9ddd0d6088..27b66167a382 100644 --- a/packages/backend/src/core/NoteCreateService.ts +++ b/packages/backend/src/core/NoteCreateService.ts @@ -955,6 +955,9 @@ export class NoteCreateService implements OnApplicationShutdown { } if (note.visibility === 'public' && this.vmimiRelayTimelineService.isRelayedInstance(note.userHost)) { this.fanoutTimelineService.push('vmimiRelayTimelineWithReplies', note.id, meta.vmimiRelayTimelineCacheMax, r); + if (note.replyUserHost == null) { + this.fanoutTimelineService.push(`vmimiRelayTimelineWithReplyTo:${note.replyUserId}`, note.id, meta.vmimiRelayTimelineCacheMax / 10, r); + } } } else { this.fanoutTimelineService.push(`userTimeline:${user.id}`, note.id, note.userHost == null ? meta.perLocalUserUserTimelineCacheMax : meta.perRemoteUserUserTimelineCacheMax, r); diff --git a/packages/backend/src/server/api/endpoints/notes/vmimi-relay-hybrid-timeline.ts b/packages/backend/src/server/api/endpoints/notes/vmimi-relay-hybrid-timeline.ts index 027e16a3470f..483bca4d2ecd 100644 --- a/packages/backend/src/server/api/endpoints/notes/vmimi-relay-hybrid-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/vmimi-relay-hybrid-timeline.ts @@ -132,6 +132,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint- timelineConfig = [ `homeTimeline:${me.id}`, 'vmimiRelayTimeline', + `vmimiRelayTimelineWithReplyTo:${me.id}`, ]; } diff --git a/packages/backend/src/server/api/endpoints/notes/vmimi-relay-timeline.ts b/packages/backend/src/server/api/endpoints/notes/vmimi-relay-timeline.ts index 032eaf06f714..4dc1e3b78100 100644 --- a/packages/backend/src/server/api/endpoints/notes/vmimi-relay-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/vmimi-relay-timeline.ts @@ -119,6 +119,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint- redisTimelines: ps.withFiles ? ['vmimiRelayTimelineWithFiles'] : ps.withReplies ? ['vmimiRelayTimeline', 'vmimiRelayTimelineWithReplies'] + : me ? ['vmimiRelayTimeline', `vmimiRelayTimelineWithReplyTo:${me.id}`] : ['vmimiRelayTimeline'], alwaysIncludeMyNotes: true, excludePureRenotes: !ps.withRenotes,