diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2023-10-04 11:48:51 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2023-10-04 11:48:51 +0900 |
| commit | 3dd84f78240fc7fbeca9272f3941d90986f46c0a (patch) | |
| tree | 1572efaa3eb90c6d806b200e24a137565ee56f4a /packages/backend/src/core/NoteCreateService.ts | |
| parent | tweak (diff) | |
| download | sharkey-3dd84f78240fc7fbeca9272f3941d90986f46c0a.tar.gz sharkey-3dd84f78240fc7fbeca9272f3941d90986f46c0a.tar.bz2 sharkey-3dd84f78240fc7fbeca9272f3941d90986f46c0a.zip | |
tweak
Diffstat (limited to 'packages/backend/src/core/NoteCreateService.ts')
| -rw-r--r-- | packages/backend/src/core/NoteCreateService.ts | 58 |
1 files changed, 27 insertions, 31 deletions
diff --git a/packages/backend/src/core/NoteCreateService.ts b/packages/backend/src/core/NoteCreateService.ts index 7e1c0b5c22..3ea8af5cda 100644 --- a/packages/backend/src/core/NoteCreateService.ts +++ b/packages/backend/src/core/NoteCreateService.ts @@ -481,12 +481,10 @@ export class NoteCreateService implements OnApplicationShutdown { // Increment notes count (user) this.incNotesCountOfUser(user); - if (data.visibility === 'public' || data.visibility === 'home') { - this.pushToTl(note, user); - } else if (data.visibility === 'followers') { + if (data.visibility === 'specified') { + // TODO? + } else { this.pushToTl(note, user); - } else if (data.visibility === 'specified') { - // TODO } this.antennaService.addNoteToAntennas(note, user); @@ -913,43 +911,41 @@ export class NoteCreateService implements OnApplicationShutdown { } } - if (note.visibility === 'public' || note.visibility === 'home') { - // 自分自身以外への返信 - if (note.replyId && note.replyUserId !== note.userId) { + // 自分自身以外への返信 + if (note.replyId && note.replyUserId !== note.userId) { + redisPipeline.xadd( + `userTimelineWithReplies:${user.id}`, + 'MAXLEN', '~', note.userHost == null ? meta.perLocalUserUserTimelineCacheMax.toString() : meta.perRemoteUserUserTimelineCacheMax.toString(), + '*', + 'note', note.id); + } else { + redisPipeline.xadd( + `userTimeline:${user.id}`, + 'MAXLEN', '~', note.userHost == null ? meta.perLocalUserUserTimelineCacheMax.toString() : meta.perRemoteUserUserTimelineCacheMax.toString(), + '*', + 'note', note.id); + + if (note.fileIds.length > 0) { redisPipeline.xadd( - `userTimelineWithReplies:${user.id}`, - 'MAXLEN', '~', note.userHost == null ? meta.perLocalUserUserTimelineCacheMax.toString() : meta.perRemoteUserUserTimelineCacheMax.toString(), + `userTimelineWithFiles:${user.id}`, + 'MAXLEN', '~', note.userHost == null ? (meta.perLocalUserUserTimelineCacheMax / 2).toString() : (meta.perRemoteUserUserTimelineCacheMax / 2).toString(), '*', 'note', note.id); - } else { + } + + if (note.visibility === 'public' && note.userHost == null) { redisPipeline.xadd( - `userTimeline:${user.id}`, - 'MAXLEN', '~', note.userHost == null ? meta.perLocalUserUserTimelineCacheMax.toString() : meta.perRemoteUserUserTimelineCacheMax.toString(), + 'localTimeline', + 'MAXLEN', '~', '1000', '*', 'note', note.id); if (note.fileIds.length > 0) { redisPipeline.xadd( - `userTimelineWithFiles:${user.id}`, - 'MAXLEN', '~', note.userHost == null ? (meta.perLocalUserUserTimelineCacheMax / 2).toString() : (meta.perRemoteUserUserTimelineCacheMax / 2).toString(), - '*', - 'note', note.id); - } - - if (note.visibility === 'public' && note.userHost == null) { - redisPipeline.xadd( - 'localTimeline', - 'MAXLEN', '~', '1000', + 'localTimelineWithFiles', + 'MAXLEN', '~', '500', '*', 'note', note.id); - - if (note.fileIds.length > 0) { - redisPipeline.xadd( - 'localTimelineWithFiles', - 'MAXLEN', '~', '500', - '*', - 'note', note.id); - } } } } |