Running astyle.
This commit is contained in:
@@ -9,26 +9,26 @@ BadWordCheck::BadWordCheck()
|
||||
bool BadWordCheck::run(QString msg)
|
||||
{
|
||||
msg = msg.toLower();
|
||||
bool badMessage(false);
|
||||
bool badMessage(false);
|
||||
|
||||
QStringListIterator it(badWords);
|
||||
while (it.hasNext()) {
|
||||
QString bw=it.next();
|
||||
if(msg.contains(bw)) {
|
||||
badMessage=true;
|
||||
QString bw=it.next();
|
||||
if(msg.contains(bw)) {
|
||||
badMessage=true;
|
||||
|
||||
//exception check
|
||||
QStringListIterator it2(badWordsException);
|
||||
while (it2.hasNext()) {
|
||||
QString bwe=it2.next();
|
||||
if(bwe.contains(bw) && msg.contains(bwe)) {
|
||||
badMessage=false;
|
||||
}
|
||||
}
|
||||
}
|
||||
//exception check
|
||||
QStringListIterator it2(badWordsException);
|
||||
while (it2.hasNext()) {
|
||||
QString bwe=it2.next();
|
||||
if(bwe.contains(bw) && msg.contains(bwe)) {
|
||||
badMessage=false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(badMessage) return true;
|
||||
else return false;
|
||||
if(badMessage) return true;
|
||||
else return false;
|
||||
|
||||
}
|
||||
|
||||
@@ -13,16 +13,16 @@ public:
|
||||
badWords = bw;
|
||||
}
|
||||
|
||||
void setBadWordsException(QStringList bwe) {
|
||||
badWordsException = bwe;
|
||||
}
|
||||
void setBadWordsException(QStringList bwe) {
|
||||
badWordsException = bwe;
|
||||
}
|
||||
|
||||
bool run(QString);
|
||||
|
||||
private:
|
||||
|
||||
QStringList badWords;
|
||||
QStringList badWordsException;
|
||||
QStringList badWordsException;
|
||||
};
|
||||
|
||||
#endif // BADWORDCHECK_H
|
||||
|
||||
@@ -43,7 +43,7 @@ using namespace std;
|
||||
CleanerConfig::CleanerConfig()
|
||||
{
|
||||
// !!!! Revisionsnummer der Configdefaults !!!!!
|
||||
configRev = 9;
|
||||
configRev = 9;
|
||||
|
||||
// Pfad und Dateinamen setzen
|
||||
#ifdef _WIN32
|
||||
@@ -158,9 +158,9 @@ CleanerConfig::CleanerConfig()
|
||||
badWordsList.push_back("whore");
|
||||
configList.push_back(ConfigInfo("BadWordsList", CONFIG_TYPE_STRING_LIST, "BadWords", badWordsList));
|
||||
|
||||
list<string> badWordsExceptionList;
|
||||
badWordsExceptionList.push_back("idiots end");
|
||||
configList.push_back(ConfigInfo("BadWordsException", CONFIG_TYPE_STRING_LIST, "BadWordsException", badWordsExceptionList));
|
||||
list<string> badWordsExceptionList;
|
||||
badWordsExceptionList.push_back("idiots end");
|
||||
configList.push_back(ConfigInfo("BadWordsException", CONFIG_TYPE_STRING_LIST, "BadWordsException", badWordsExceptionList));
|
||||
|
||||
|
||||
list<string> urlStringsList;
|
||||
|
||||
@@ -178,20 +178,20 @@ void MessageFilter::refreshConfig()
|
||||
// special check settings
|
||||
//Bad Words
|
||||
std::list<std::string> badWordsList = config->readConfigStringList("BadWordsList");
|
||||
std::list<std::string>::iterator it0;
|
||||
std::list<std::string>::iterator it0;
|
||||
QStringList bwList;
|
||||
for(it0= badWordsList.begin(); it0 != badWordsList.end(); ++it0) {
|
||||
bwList << QString::fromUtf8(it0->c_str());
|
||||
for(it0= badWordsList.begin(); it0 != badWordsList.end(); ++it0) {
|
||||
bwList << QString::fromUtf8(it0->c_str());
|
||||
}
|
||||
myBadWordCheck->setBadWords(bwList);
|
||||
|
||||
std::list<std::string> badWordsExceptionList = config->readConfigStringList("BadWordsList");
|
||||
std::list<std::string>::iterator it1;
|
||||
QStringList bweList;
|
||||
for(it1= badWordsExceptionList.begin(); it1 != badWordsExceptionList.end(); ++it1) {
|
||||
bweList << QString::fromUtf8(it1->c_str());
|
||||
}
|
||||
myBadWordCheck->setBadWordsException(bweList);
|
||||
std::list<std::string> badWordsExceptionList = config->readConfigStringList("BadWordsList");
|
||||
std::list<std::string>::iterator it1;
|
||||
QStringList bweList;
|
||||
for(it1= badWordsExceptionList.begin(); it1 != badWordsExceptionList.end(); ++it1) {
|
||||
bweList << QString::fromUtf8(it1->c_str());
|
||||
}
|
||||
myBadWordCheck->setBadWordsException(bweList);
|
||||
|
||||
std::list<std::string> urlStringsList = config->readConfigStringList("UrlStringsList");
|
||||
std::list<std::string>::iterator it2;
|
||||
|
||||
Reference in New Issue
Block a user