diff --git a/packages/backend/src/config.ts b/packages/backend/src/config.ts index f263c4d06b06..cb92bd877920 100644 --- a/packages/backend/src/config.ts +++ b/packages/backend/src/config.ts @@ -100,6 +100,7 @@ type Source = { maxWebImageSize?: number; withRepliesInHomeTL?: boolean; withRepliesInUserList?: boolean; + blockMentionsFromUnfamiliarRemoteUsers?: boolean; } }; @@ -185,6 +186,7 @@ export type Config = { maxWebImageSize?: number; withRepliesInHomeTL?: boolean, withRepliesInUserList: boolean, + blockMentionsFromUnfamiliarRemoteUsers: boolean; } }; @@ -230,6 +232,7 @@ export function loadConfig(): Config { // to avoid merge conflict in the future, this is at top nirila: Object.assign({ withRepliesInUserList: true, + blockMentionsFromUnfamiliarRemoteUsers: false, }, config.nirila ?? {}), version, publishTarballInsteadOfProvideRepositoryUrl: !!config.publishTarballInsteadOfProvideRepositoryUrl, diff --git a/packages/backend/src/core/NoteCreateService.ts b/packages/backend/src/core/NoteCreateService.ts index ff3e10e43b20..5297f1e2d3e6 100644 --- a/packages/backend/src/core/NoteCreateService.ts +++ b/packages/backend/src/core/NoteCreateService.ts @@ -368,7 +368,7 @@ export class NoteCreateService implements OnApplicationShutdown { const willCauseNotification = mentionedUsers.filter(u => u.host === null).length > 0 || data.reply?.userHost === null || data.renote?.userHost === null; - if (process.env.MISSKEY_BLOCK_MENTIONS_FROM_UNFAMILIAR_REMOTE_USERS === 'true' && user.host !== null && willCauseNotification) { + if (this.config.nirila.blockMentionsFromUnfamiliarRemoteUsers && user.host !== null && willCauseNotification) { const userEntity = await this.usersRepository.findOneBy({ id: user.id }); if ((userEntity?.followersCount ?? 0) === 0) { this.logger.error('Request rejected because user has no local followers', { user: user.id, note: data });