chatcleaner: inital url spam check. configurable url string list and

exceptions list for urls like pokerth.net ;-)
This commit is contained in:
doitux
2009-07-31 19:01:33 +00:00
parent 0a41384d9e
commit ea5bf107f4
6 changed files with 96 additions and 6 deletions
+29
View File
@@ -0,0 +1,29 @@
#include "urlcheck.h"
#include <QtCore>
UrlCheck::UrlCheck()
{
}
bool UrlCheck::run(QString msg)
{
msg = msg.toLower();
QStringListIterator it1(urlStrings);
while (it1.hasNext()) {
if(msg.contains(it1.next())) {
QStringListIterator it2(urlExceptionStrings);
bool exception = false;
while (it2.hasNext()) {
if(msg.contains(it2.next())) {
exception = true;
break;
}
}
if(!exception) { return true; }
}
}
return false;
}