moderation.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00029 #ifndef MODULE_H
00030 #define MODULE_H
00031 #include "../plugin.h"
00032 #include "../botkernel.h"
00033
00034 #ifndef HAVE_TINYXML
00035 #include "../tinyxml/tinyxml.h"
00036 #else
00037 #include <tinyxml.h>
00038 #endif
00039
00040
00041 #include "admin.h"
00042 #include "usersinfos.h"
00043 #include <time.h>
00044 #include <map>
00045 using namespace std;
00046
00053 class Moderation : public Plugin
00054 {
00055 private:
00057 TiXmlDocument * doc ;
00059 TiXmlNode* root;
00061 void initFile();
00063 map<string,int> rejoinAttempts;
00064 public:
00066 Moderation(BotKernel*);
00068 bool addBan(string,string,unsigned int,string,string);
00070 string delBan(string,unsigned int);
00072 bool isBanned(string,string);
00074 vector<string> getBanList(string);
00076 vector<string> banInfos(string,unsigned int);
00078 vector<string> clearList(string);
00080 vector<string> clearOutBans(vector<string>);
00082 bool checkAccess(string,string,unsigned int,BotKernel*);
00084 bool hasOpPrivileges(string,string,string,BotKernel*);
00086 vector<string*> getChanUsersList(string,BotKernel*);
00088 bool checkMode(string,string,char,BotKernel*);
00090 unsigned int getRejoinAttempts(string);
00092 void bumpRejoinAttempts(string);
00094 void clearRejoinAttempts(string);
00095 };
00096
00097
00098 #endif
00099