From a27af00e23a5283e357de1e6bf2a47ebefaa77c2 Mon Sep 17 00:00:00 2001 From: Ebise Lutica <7106976+EbiseLutica@users.noreply.github.com> Date: Sun, 18 Feb 2024 02:12:23 +0900 Subject: [PATCH] =?UTF-8?q?Renote=E3=83=BBReply=E3=82=82=E5=AF=BE=E8=B1=A1?= =?UTF-8?q?=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/backend/src/core/NoteCreateService.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/core/NoteCreateService.ts b/packages/backend/src/core/NoteCreateService.ts index c02601e97723..8cb1d0c49844 100644 --- a/packages/backend/src/core/NoteCreateService.ts +++ b/packages/backend/src/core/NoteCreateService.ts @@ -359,11 +359,13 @@ export class NoteCreateService implements OnApplicationShutdown { mentionedUsers = data.apMentions ?? await this.extractMentionedUsers(user, combinedTokens); } + const willCauseNotification = mentionedUsers.length > 0 || data.reply?.userHost === null || data.renote?.userHost === null; + // #region Shrimpia - if (user.host != null && mentionedUsers.length > 0) { + if (user.host != null && willCauseNotification) { const userEntity = await this.usersRepository.findOneBy({ id: user.id }); if ((userEntity?.followersCount ?? 0) === 0) { - throw new Error('Temporarily, notes including mentions from remote users which no followers are not allowed'); + throw new Error('Temporarily, notes including mentions, replies and renotes to local-user from remote users which is not followed by local-users are not allowed'); } } // #endregion