#include <ignore.h>
Public Member Functions | |
Ignore (BotKernel *) | |
Constructor. | |
void | addIgnore (string, string, unsigned int) |
Add a host to the ignore list. | |
bool | delIgnore (unsigned int) |
Remove a host from ignore list. | |
bool | isIgnored (string) |
Tell if a host is ignored. | |
vector< string > | getIgnoreList () |
Return the ignore list. | |
void | purifyList () |
Clear the XML file from out dated ignores. | |
Private Member Functions | |
void | initFile () |
Initialize the XML file. | |
Private Attributes | |
TiXmlDocument * | doc |
Represent the xml document. | |
TiXmlNode * | root |
Represent documents's root. |
This class provides an ignore system that allow the bot to ignore users
Definition at line 51 of file ignore.h.
Ignore::Ignore | ( | BotKernel * | b | ) |
Constructor.
Constructor
Definition at line 34 of file ignore.cpp.
References Plugin::addRequirement(), Plugin::author, Plugin::bindFunction(), Plugin::description, doc, BotKernel::getDatasDir(), IN_BEFORE_TREATMENT, IN_COMMAND_HANDLER, IN_LOOP, initFile(), Plugin::name, root, and Plugin::version.
void Ignore::addIgnore | ( | string | mask, | |
string | by, | |||
unsigned int | duration | |||
) |
Add a host to the ignore list.
Add a host to the ignore list
mask | mask to ignore | |
by | User mask that add the ignore | |
duration | Ignore duration (in seconsd) |
Definition at line 76 of file ignore.cpp.
References doc, root, and Tools::to_lower().
Referenced by addIgnore().
bool Ignore::delIgnore | ( | unsigned int | index | ) |
Remove a host from ignore list.
Del a host from the ignore list
index | Ignore index |
Definition at line 96 of file ignore.cpp.
References doc.
Referenced by delIgnore().
vector< string > Ignore::getIgnoreList | ( | ) |
Return the ignore list.
Give the ignore list
Definition at line 136 of file ignore.cpp.
References Tools::intToStr(), root, and Tools::strToInt().
Referenced by ignoreList().
void Ignore::initFile | ( | ) | [private] |
Initialize the XML file.
Initilaize the XML file by creating root and first childs (file empty structure)
Definition at line 62 of file ignore.cpp.
Referenced by Ignore().
bool Ignore::isIgnored | ( | string | host | ) |
Tell if a host is ignored.
Check if a host is ignored
host | Host to check |
Definition at line 117 of file ignore.cpp.
References Tools::ircMaskMatch(), root, and Tools::to_lower().
Referenced by isIgnored(), and testIgnoredUser().
void Ignore::purifyList | ( | ) |
Clear the XML file from out dated ignores.
Clear ignore list from outdated ignores
Definition at line 164 of file ignore.cpp.
References doc, root, and Tools::strToInt().
Referenced by purifyList().
TiXmlDocument* Ignore::doc [private] |
Represent the xml document.
Definition at line 55 of file ignore.h.
Referenced by addIgnore(), delIgnore(), Ignore(), initFile(), and purifyList().
TiXmlNode* Ignore::root [private] |
Represent documents's root.
Definition at line 57 of file ignore.h.
Referenced by addIgnore(), getIgnoreList(), Ignore(), initFile(), isIgnored(), and purifyList().