From 738b4d69701a9d4b232f6a44b340782d096b182b Mon Sep 17 00:00:00 2001 From: Ebise Lutica <7106976+EbiseLutica@users.noreply.github.com> Date: Sun, 18 Feb 2024 01:47:18 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=87=AA=E5=88=86=E3=81=AE=E3=82=B5?= =?UTF-8?q?=E3=83=BC=E3=83=90=E3=83=BC=E3=81=A7=E8=AA=B0=E3=82=82=E3=83=95?= =?UTF-8?q?=E3=82=A9=E3=83=AD=E3=83=BC=E3=81=97=E3=81=A6=E3=81=84=E3=81=AA?= =?UTF-8?q?=E3=81=84=E3=80=81=E3=83=AA=E3=83=A2=E3=83=BC=E3=83=88=E3=83=A6?= =?UTF-8?q?=E3=83=BC=E3=82=B6=E3=83=BC=E3=81=8B=E3=82=89=E3=81=AE=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=82=B7=E3=83=A7=E3=83=B3=E3=82=92=E6=8B=92=E5=90=A6?= =?UTF-8?q?=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/backend/src/core/NoteCreateService.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/backend/src/core/NoteCreateService.ts b/packages/backend/src/core/NoteCreateService.ts index 9cec614d5c87..5a1d174d926f 100644 --- a/packages/backend/src/core/NoteCreateService.ts +++ b/packages/backend/src/core/NoteCreateService.ts @@ -359,6 +359,15 @@ export class NoteCreateService implements OnApplicationShutdown { mentionedUsers = data.apMentions ?? await this.extractMentionedUsers(user, combinedTokens); } + // #region Shrimpia + if (user.host != null && mentionedUsers.some(u => u.host !== null)) { + const userEntity = await this.usersRepository.findOneByOrFail({ id: user.id }); + if (userEntity.followersCount === 0) { + throw new Error('Temporarily, notes including mentions from remote users which no followers are not allowed'); + } + } + // #endregion + tags = tags.filter(tag => Array.from(tag).length <= 128).splice(0, 32); if (data.reply && (user.id !== data.reply.userId) && !mentionedUsers.some(u => u.id === data.reply!.userId)) {