From 603205dfe3768df2e2b4aa4c8e56dd11d66b771a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=BE=E3=81=A3=E3=81=A1=E3=82=83=E3=81=A8=E3=83=BC?= =?UTF-8?q?=E3=81=AB=E3=82=85?= <17376330+u1-liquid@users.noreply.github.com> Date: Thu, 15 Feb 2024 04:51:42 +0900 Subject: [PATCH] =?UTF-8?q?enhance(NoteCreateService):=20=E3=82=BB?= =?UTF-8?q?=E3=83=B3=E3=82=B7=E3=83=86=E3=82=A3=E3=83=96=E3=83=AF=E3=83=BC?= =?UTF-8?q?=E3=83=89=E3=83=BB=E7=A6=81=E6=AD=A2=E3=83=AF=E3=83=BC=E3=83=89?= =?UTF-8?q?=E8=A8=AD=E5=AE=9A=E3=81=AB=E9=96=A2=E3=81=99=E3=82=8B=E3=83=AD?= =?UTF-8?q?=E3=82=B0=E3=82=92=E8=BF=BD=E5=8A=A0=20(MisskeyIO#452)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/backend/src/core/NoteCreateService.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/backend/src/core/NoteCreateService.ts b/packages/backend/src/core/NoteCreateService.ts index c9b71e49ba..84660b05e6 100644 --- a/packages/backend/src/core/NoteCreateService.ts +++ b/packages/backend/src/core/NoteCreateService.ts @@ -263,12 +263,14 @@ export class NoteCreateService implements OnApplicationShutdown { const sensitiveWords = meta.sensitiveWords; if (this.utilityService.isKeyWordIncluded(data.cw ?? data.text ?? '', sensitiveWords)) { data.visibility = 'home'; + this.logger.warn('Visibility changed to home because sensitive words are included', { user: user.id, note: data }); } else if ((await this.roleService.getUserPolicies(user.id)).canPublicNote === false) { data.visibility = 'home'; } } if (this.utilityService.isKeyWordIncluded(data.cw ?? data.text ?? '', meta.prohibitedWords)) { + this.logger.error('Request rejected because prohibited words are included', { user: user.id, note: data }); throw new IdentifiableError('057d8d3e-b7ca-4f8b-b38c-dcdcbf34dc30'); }