This commit is contained in:
syuilo 2020-02-21 00:28:45 +09:00
parent 7de915d47b
commit c7c08b7511
10 changed files with 58 additions and 2 deletions

View file

@ -52,6 +52,19 @@ export async function checkHitAntenna(antenna: Antenna, note: Note, noteUser: Us
if (!matched) return false;
}
if (antenna.excludeKeywords.length > 0) {
if (note.text == null) return false;
const matched = antenna.excludeKeywords.some(keywords =>
keywords.every(keyword =>
antenna.caseSensitive
? note.text!.includes(keyword)
: note.text!.toLowerCase().includes(keyword.toLowerCase())
));
if (matched) return false;
}
if (antenna.withFile) {
if (note.fileIds.length === 0) return false;
}