From 341c564d49d36e6001effcf7634d46170336d5ec Mon Sep 17 00:00:00 2001 From: doitux Date: Tue, 25 Dec 2012 22:31:49 +0100 Subject: [PATCH] hopefully bugfix for chatbot regression (#164) --- src/chatcleaner/badwordcheck.cpp | 2 -- src/chatcleaner/cleanerconfig.cpp | 7 ++++++- src/chatcleaner/messagefilter.cpp | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/chatcleaner/badwordcheck.cpp b/src/chatcleaner/badwordcheck.cpp index ce0e9655..5ede77a0 100644 --- a/src/chatcleaner/badwordcheck.cpp +++ b/src/chatcleaner/badwordcheck.cpp @@ -46,7 +46,6 @@ bool BadWordCheck::run(QString msg) QString bw=it.next(); if(msg.contains(bw)) { badMessage=true; - //exception check QStringListIterator it2(badWordsException); while (it2.hasNext()) { @@ -60,5 +59,4 @@ bool BadWordCheck::run(QString msg) if(badMessage) return true; else return false; - } diff --git a/src/chatcleaner/cleanerconfig.cpp b/src/chatcleaner/cleanerconfig.cpp index 4a5bf970..cee11f61 100644 --- a/src/chatcleaner/cleanerconfig.cpp +++ b/src/chatcleaner/cleanerconfig.cpp @@ -54,7 +54,7 @@ using namespace std; CleanerConfig::CleanerConfig() { // !!!! Revisionsnummer der Configdefaults !!!!! - configRev = 9; + configRev = 10; // Pfad und Dateinamen setzen #ifdef _WIN32 @@ -149,6 +149,7 @@ CleanerConfig::CleanerConfig() badWordsList.push_back("gay"); badWordsList.push_back("horny"); badWordsList.push_back("hure"); + badWordsList.push_back("idiot"); badWordsList.push_back("mistgeburt"); badWordsList.push_back("missgeburt"); badWordsList.push_back("motherfucker"); @@ -171,6 +172,10 @@ CleanerConfig::CleanerConfig() list badWordsExceptionList; badWordsExceptionList.push_back("idiots end"); + badWordsExceptionList.push_back("all-in-idiot"); + badWordsExceptionList.push_back("all-in idiot"); + badWordsExceptionList.push_back("allin idiot"); + badWordsExceptionList.push_back("all in idiot"); configList.push_back(ConfigInfo("BadWordsException", CONFIG_TYPE_STRING_LIST, "BadWordsException", badWordsExceptionList)); diff --git a/src/chatcleaner/messagefilter.cpp b/src/chatcleaner/messagefilter.cpp index 53c335c9..603bbcee 100644 --- a/src/chatcleaner/messagefilter.cpp +++ b/src/chatcleaner/messagefilter.cpp @@ -214,7 +214,7 @@ void MessageFilter::refreshConfig() } myBadWordCheck->setBadWords(bwList); - std::list badWordsExceptionList = config->readConfigStringList("BadWordsList"); + std::list badWordsExceptionList = config->readConfigStringList("BadWordsException"); std::list::iterator it1; QStringList bweList; for(it1= badWordsExceptionList.begin(); it1 != badWordsExceptionList.end(); ++it1) {