* | Inspire Internet Relay Chat Daemon |
* +------------------------------------+
*
- * InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ * InspIRCd: (C) 2002-2008 InspIRCd Development Team
* See: http://www.inspircd.org/wiki/index.php/Credits
*
* This program is free but copyrighted software; see
public:
ModuleXLineDB(InspIRCd* Me) : Module(Me)
{
- Implementation eventlist[] = { I_OnAddLine, I_OnDelLine };
- ServerInstance->Modules->Attach(eventlist, this, 2);
+ Implementation eventlist[] = { I_OnAddLine, I_OnDelLine, I_OnExpireLine };
+ ServerInstance->Modules->Attach(eventlist, this, 3);
reading_db = true;
ReadDatabase();
*/
void OnAddLine(User* source, XLine* line)
{
+ ServerInstance->Log(DEBUG, "xlinedb: Adding a line");
xlines.push_back(line);
- for (std::vector<XLine *>::iterator i = xlines.begin(); i != xlines.end(); i++)
- {
- line = (*i);
- ServerInstance->WriteOpers("%s %s %s %lu %lu :%s", line->type.c_str(), line->Displayable(),
-ServerInstance->Config->ServerName, line->set_time, line->duration, line->reason);
- }
-
if (!reading_db)
{
WriteDatabase();
*/
void OnDelLine(User* source, XLine* line)
{
+ RemoveLine(line);
+ }
+
+ void OnExpireLine(XLine *line)
+ {
+ RemoveLine(line);
+ }
+
+ void RemoveLine(XLine *line)
+ {
+ ServerInstance->Log(DEBUG, "xlinedb: Removing a line");
for (std::vector<XLine *>::iterator i = xlines.begin(); i != xlines.end(); i++)
{
if ((*i) == line)