fix(chat-filter): shipped blocklist.dcf in the portable format

The shipped list's hashes are 64-bit FNV-1a (checked against a sample of
its words), so it is written again as version 3: same hashes, duplicates
dropped, sorted. Nothing else changes; it can be replaced by building
from blocklist.txt. issue 215

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-09-30 08:05:00 -05:00
parent c1bcda8dd1
commit b279d187ca
2 changed files with 9 additions and 0 deletions

Binary file not shown.

View File

@@ -147,3 +147,12 @@ TEST(ChatFilterCoreTest, DashboardPhrasesInWhitelistChat) {
lists.customAllowed.AddEntry("stranger");
EXPECT_TRUE(CheckMessage("hello stranger", true, lists).empty());
}
TEST(ChatFilterCoreTest, ShippedBlockListIsPortable) {
const auto parsed = dChatFilterDCF::ReadFile(std::string(DLU_SOURCE_DIR) + "/resources/blocklist.dcf");
ASSERT_EQ(parsed.status, dChatFilterDCF::eStatus::OK);
Lists lists;
lists.denied = parsed.list;
EXPECT_EQ(CheckMessage("what crap", false, lists), (Spans{ { 5, 4 } }));
EXPECT_TRUE(CheckMessage("hello there", false, lists).empty());
}