fix(antenna): src=list && userListId=null の場合クエリータイムアウトが発生する問題を修正 (MisskeyIO#721)

(cherry picked from commit 47b6b97c9c6d9583dd1b11acbf8f94059e81ebaf)
This commit is contained in:
まっちゃとーにゅ 2024-09-16 21:37:42 +09:00 committed by kakkokari-gtyih
parent 7d7a12d7d6
commit d49ac329ea
1 changed files with 8 additions and 5 deletions

View File

@ -123,11 +123,14 @@ export class AntennaService implements OnApplicationShutdown {
if (antenna.src === 'home') {
// TODO
} else if (antenna.src === 'list') {
const listUsers = (await this.userListMembershipsRepository.findBy({
userListId: antenna.userListId!,
})).map(x => x.userId);
if (!listUsers.includes(note.userId)) return false;
if (antenna.userListId == null) return false;
const exists = await this.userListMembershipsRepository.exists({
where: {
userListId: antenna.userListId,
userId: note.userId,
},
});
if (!exists) return false;
} else if (antenna.src === 'users') {
const accts = antenna.users.map(x => {
const { username, host } = Acct.parse(x);