diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2023-01-09 14:12:42 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2023-01-09 14:12:42 +0900 |
| commit | e4144a17a44b98229d0c0b18969d3d86a768a43d (patch) | |
| tree | 387730590396589360ecb8d8f2e97087a1d50291 /packages/backend/src/core | |
| parent | fix(server): 特定のPNG画像のアップロードに失敗する問題を... (diff) | |
| download | sharkey-e4144a17a44b98229d0c0b18969d3d86a768a43d.tar.gz sharkey-e4144a17a44b98229d0c0b18969d3d86a768a43d.tar.bz2 sharkey-e4144a17a44b98229d0c0b18969d3d86a768a43d.zip | |
fix(server): アンテナタイムライン(ストリーミング)が、フォローしていないユーザーの鍵投稿も拾ってしまう問題を修正
Fix #9025
Diffstat (limited to 'packages/backend/src/core')
| -rw-r--r-- | packages/backend/src/core/AntennaService.ts | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/packages/backend/src/core/AntennaService.ts b/packages/backend/src/core/AntennaService.ts index d6f326f616..1b5abce29a 100644 --- a/packages/backend/src/core/AntennaService.ts +++ b/packages/backend/src/core/AntennaService.ts @@ -15,8 +15,8 @@ import type { Packed } from '@/misc/schema.js'; import { DI } from '@/di-symbols.js'; import type { MutingsRepository, BlockingsRepository, NotesRepository, AntennaNotesRepository, AntennasRepository, UserGroupJoiningsRepository, UserListJoiningsRepository } from '@/models/index.js'; import { UtilityService } from '@/core/UtilityService.js'; -import type { OnApplicationShutdown } from '@nestjs/common'; import { bindThis } from '@/decorators.js'; +import type { OnApplicationShutdown } from '@nestjs/common'; @Injectable() export class AntennaService implements OnApplicationShutdown { @@ -135,7 +135,7 @@ export class AntennaService implements OnApplicationShutdown { this.globalEventServie.publishMainStream(antenna.userId, 'unreadAntenna', antenna); this.pushNotificationService.pushNotification(antenna.userId, 'unreadAntennaNote', { antenna: { id: antenna.id, name: antenna.name }, - note: await this.noteEntityService.pack(note) + note: await this.noteEntityService.pack(note), }); } }, 2000); @@ -144,27 +144,19 @@ export class AntennaService implements OnApplicationShutdown { // NOTE: フォローしているユーザーのノート、リストのユーザーのノート、グループのユーザーのノート指定はパフォーマンス上の理由で無効になっている - /** - * noteUserFollowers / antennaUserFollowing はどちらか一方が指定されていればよい - */ @bindThis - public async checkHitAntenna(antenna: Antenna, note: (Note | Packed<'Note'>), noteUser: { id: User['id']; username: string; host: string | null; }, noteUserFollowers?: User['id'][], antennaUserFollowing?: User['id'][]): Promise<boolean> { + public async checkHitAntenna(antenna: Antenna, note: (Note | Packed<'Note'>), noteUser: { id: User['id']; username: string; host: string | null; }): Promise<boolean> { if (note.visibility === 'specified') return false; - + if (note.visibility === 'followers') return false; + // アンテナ作成者がノート作成者にブロックされていたらスキップ const blockings = await this.blockingCache.fetch(noteUser.id, () => this.blockingsRepository.findBy({ blockerId: noteUser.id }).then(res => res.map(x => x.blockeeId))); if (blockings.some(blocking => blocking === antenna.userId)) return false; - if (note.visibility === 'followers') { - if (noteUserFollowers && !noteUserFollowers.includes(antenna.userId)) return false; - if (antennaUserFollowing && !antennaUserFollowing.includes(note.userId)) return false; - } - if (!antenna.withReplies && note.replyId != null) return false; if (antenna.src === 'home') { - if (noteUserFollowers && !noteUserFollowers.includes(antenna.userId)) return false; - if (antennaUserFollowing && !antennaUserFollowing.includes(note.userId)) return false; + // TODO } else if (antenna.src === 'list') { const listUsers = (await this.userListJoiningsRepository.findBy({ userListId: antenna.userListId!, |