diff --git a/packages/backend/src/core/NoteCreateService.ts b/packages/backend/src/core/NoteCreateService.ts index 5fcc6425ac..d9f31079ca 100644 --- a/packages/backend/src/core/NoteCreateService.ts +++ b/packages/backend/src/core/NoteCreateService.ts @@ -481,7 +481,13 @@ export class NoteCreateService implements OnApplicationShutdown { if (data.reply) { // TODO } else { - this.pushToTl(note, user); + if (data.visibility === 'public' || data.visibility === 'home') { + this.pushToTl(note, user); + } else if (data.visibility === 'followers') { + this.pushToTl(note, user); + } else if (data.visibility === 'specified') { + // TODO + } } this.antennaService.addNoteToAntennas(note, user); @@ -807,7 +813,7 @@ export class NoteCreateService implements OnApplicationShutdown { select: ['followerId'], }); - const userLists = await this.userListJoiningsRepository.find({ + let userLists = await this.userListJoiningsRepository.find({ where: { userId: user.id, }, @@ -833,6 +839,11 @@ export class NoteCreateService implements OnApplicationShutdown { } } + if (note.visibility === 'followers') { + // TODO: 重そうだから何とかしたい Set 使う? + userLists = userLists.filter(x => followings.some(f => f.followerId === x.userListId)); + } + for (const userList of userLists) { redisPipeline.xadd( `userListTimeline:${userList.userListId}`, diff --git a/packages/backend/src/server/api/endpoints/notes/timeline.ts b/packages/backend/src/server/api/endpoints/notes/timeline.ts index a261665ab8..c76cdf28ff 100644 --- a/packages/backend/src/server/api/endpoints/notes/timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/timeline.ts @@ -106,6 +106,7 @@ export default class extends Endpoint { // eslint- // ミュート等考慮 timeline = timeline.filter(note => { // TODO: インスタンスミュートの考慮 + // TODO: ブロックの考慮 if (note.userId === me.id) { return true; diff --git a/packages/backend/src/server/api/endpoints/notes/user-list-timeline.ts b/packages/backend/src/server/api/endpoints/notes/user-list-timeline.ts index 806b006f43..8075c0d8ce 100644 --- a/packages/backend/src/server/api/endpoints/notes/user-list-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/user-list-timeline.ts @@ -132,6 +132,7 @@ export default class extends Endpoint { // eslint- // ミュート等考慮 timeline = timeline.filter(note => { // TODO: インスタンスミュートの考慮 + // TODO: ブロックの考慮 if (isUserRelated(note, userIdsWhoMeMuting)) return false; if (note.renoteId) {