This commit is contained in:
syuilo 2023-10-01 20:38:18 +09:00
parent 3dd3c69303
commit 783a97fe06
3 changed files with 15 additions and 2 deletions

View file

@ -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}`,

View file

@ -106,6 +106,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
// ミュート等考慮
timeline = timeline.filter(note => {
// TODO: インスタンスミュートの考慮
// TODO: ブロックの考慮
if (note.userId === me.id) {
return true;

View file

@ -132,6 +132,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
// ミュート等考慮
timeline = timeline.filter(note => {
// TODO: インスタンスミュートの考慮
// TODO: ブロックの考慮
if (isUserRelated(note, userIdsWhoMeMuting)) return false;
if (note.renoteId) {