Skip to content
Snippets Groups Projects
Unverified Commit 32c5c43b authored by tamaina's avatar tamaina Committed by GitHub
Browse files

enhance: 禁止ワードはリモートノートも対象に (#13280)

Resolve #13279
parent e12369ac
No related branches found
No related tags found
3 merge requests!449release 2024.3.1,!448Release 2023.3.1 - Codename #NotDeadYet,!428Merge upstream from 19th Feburary
......@@ -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);
......
......@@ -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);
});
});
......
......@@ -100,6 +100,7 @@ describe('ActivityPub', () => {
perRemoteUserUserTimelineCacheMax: 100,
blockedHosts: [] as string[],
sensitiveWords: [] as string[],
prohibitedWords: [] as string[],
} as MiMeta;
let meta = metaInitial;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment