diff --git a/packages/backend/src/core/NoteCreateService.ts b/packages/backend/src/core/NoteCreateService.ts index e304e56a3..9cec614d5 100644 --- a/packages/backend/src/core/NoteCreateService.ts +++ b/packages/backend/src/core/NoteCreateService.ts @@ -263,10 +263,8 @@ export class NoteCreateService implements OnApplicationShutdown { } } - if (!user.host) { - if (this.utilityService.isKeyWordIncluded(data.cw ?? data.text ?? '', meta.prohibitedWords)) { - throw new NoteCreateService.ContainsProhibitedWordsError(); - } + if (this.utilityService.isKeyWordIncluded(data.cw ?? data.text ?? '', meta.prohibitedWords)) { + throw new NoteCreateService.ContainsProhibitedWordsError(); } const inSilencedInstance = this.utilityService.isSilencedHost(meta.silencedHosts, user.host); diff --git a/packages/backend/test/e2e/note.ts b/packages/backend/test/e2e/note.ts index d3e834247..a5742d6e7 100644 --- a/packages/backend/test/e2e/note.ts +++ b/packages/backend/test/e2e/note.ts @@ -663,7 +663,7 @@ describe('Note', () => { assert.strictEqual(note2.body.error.code, 'CONTAINS_PROHIBITED_WORDS'); }); - test('禁止ワードを含んでいてもリモートノートはエラーにならない', async () => { + test('禁止ワードを含んでるリモートノートもエラーになる', async () => { const prohibited = await api('admin/update-meta', { prohibitedWords: [ 'test', @@ -678,7 +678,7 @@ describe('Note', () => { text: 'hogetesthuge', }, tom); - assert.strictEqual(note1.status, 200); + assert.strictEqual(note1.status, 400); }); }); diff --git a/packages/backend/test/unit/activitypub.ts b/packages/backend/test/unit/activitypub.ts index 85b82dbfe..88ff49b11 100644 --- a/packages/backend/test/unit/activitypub.ts +++ b/packages/backend/test/unit/activitypub.ts @@ -100,6 +100,7 @@ describe('ActivityPub', () => { perRemoteUserUserTimelineCacheMax: 100, blockedHosts: [] as string[], sensitiveWords: [] as string[], + prohibitedWords: [] as string[], } as MiMeta; let meta = metaInitial;