From 557601f501a3d30fc98e92f841ca37d125d9b6ee Mon Sep 17 00:00:00 2001 From: CyberRex <26585194+CyberRex0@users.noreply.github.com> Date: Wed, 22 May 2024 21:55:27 +0900 Subject: [PATCH] =?UTF-8?q?enhance(backend):=20=E6=8A=95=E7=A5=A8=E3=81=AE?= =?UTF-8?q?=E9=81=B8=E6=8A=9E=E8=82=A2=E3=81=AB=E5=AF=BE=E3=81=97=E3=81=A6?= =?UTF-8?q?=E3=82=82=E3=82=BB=E3=83=B3=E3=82=B7=E3=83=86=E3=82=A3=E3=83=96?= =?UTF-8?q?=E3=83=AF=E3=83=BC=E3=83=89=E6=A4=9C=E5=87=BA=E3=82=92=E8=A1=8C?= =?UTF-8?q?=E3=81=86=E3=82=88=E3=81=86=E3=81=AB=20(MisskeyIO#630)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/backend/src/core/NoteCreateService.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/core/NoteCreateService.ts b/packages/backend/src/core/NoteCreateService.ts index d07e3fdf9..686d41a63 100644 --- a/packages/backend/src/core/NoteCreateService.ts +++ b/packages/backend/src/core/NoteCreateService.ts @@ -255,7 +255,7 @@ export class NoteCreateService implements OnApplicationShutdown { if (data.visibility === 'public' && data.channel == null) { const sensitiveWords = meta.sensitiveWords; - if (this.utilityService.isKeyWordIncluded(data.cw ?? data.text ?? '', sensitiveWords)) { + if (this.utilityService.isKeyWordIncluded(data.cw ?? this.utilityService.concatNoteContentsForKeyWordCheck({ text: data.text, pollChoices: data.poll?.choices }), sensitiveWords)) { data.visibility = 'home'; this.logger.warn('Visibility changed to home because sensitive words are included', { user: user.id, note: data }); } else if (!policies.canPublicNote) { @@ -371,7 +371,7 @@ export class NoteCreateService implements OnApplicationShutdown { const willCauseNotification = mentionedUsers.some(u => u.host === null) || (data.visibility === 'specified' && data.visibleUsers?.some(u => u.host === null)) - || data.reply?.userHost === null || (this.isQuote(data) && data.renote?.userHost === null) || false; + || data.reply?.userHost === null || (this.isQuote(data) && data.renote.userHost === null) || false; if (process.env.MISSKEY_BLOCK_MENTIONS_FROM_UNFAMILIAR_REMOTE_USERS === 'true' && user.host !== null && willCauseNotification) { const userEntity = await this.usersRepository.findOneBy({ id: user.id });