Files
pokerth/src/chatcleaner/messagefilter.h
T

56 lines
1.2 KiB
C++
Raw Normal View History

#ifndef MESSAGEFILTER_H
#define MESSAGEFILTER_H
#include <QtCore>
#include <stdlib.h>
#include <third_party/boost/timers.hpp>
class BadWordCheck;
class TextFloodCheck;
class CleanerConfig;
2009-07-29 23:27:27 +00:00
class CapsFloodCheck;
class LetterRepeatingCheck;
class UrlCheck;
class MessageFilter: public QObject {
Q_OBJECT
public:
MessageFilter(CleanerConfig*);
2009-09-26 18:47:18 +00:00
~MessageFilter();
QStringList check(unsigned, QString, QString);
void refreshConfig();
void cleanKickCounterList();
private:
BadWordCheck *myBadWordCheck;
TextFloodCheck *myTextFloodCheck;
2009-07-29 23:27:27 +00:00
CapsFloodCheck *myCapsFloodCheck;
LetterRepeatingCheck *myLetterRepeatingCheck;
UrlCheck *myUrlCheck;
struct ClientWarnInfos {
QString nick;
int lastWarnType;
int warnLevel;
};
struct ClientKickInfos {
size_t lastKickTimestamp;
int kickNumber;
};
2009-08-18 20:37:45 +00:00
QMap<unsigned, ClientWarnInfos> myClientWarnLevelList;
QMap<QString, ClientKickInfos> myClientKickCounterList;
int warnLevelToKick;
int kickNumberToBan;
CleanerConfig *config;
boost::timers::portable::second_timer timer;
QTimer *cleanTimer;
};
#endif // MESSAGEFILTER_H