* | Inspire Internet Relay Chat Daemon |
* +------------------------------------+
*
- * InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ * InspIRCd: (C) 2002-2010 InspIRCd Development Team
* See: http://wiki.inspircd.org/Credits
*
* This program is free but copyrighted software; see
std::vector<std::string> exemptfromfilter; // List of channel names excluded from filtering.
ModuleFilter();
-
+ void init();
~ModuleFilter();
ModResult OnUserPreMessage(User* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list);
FilterResult* FilterMatch(User* user, const std::string &text, int flags);
}
ModuleFilter::ModuleFilter() : filtcommand(this), RegexEngine(this, "regex")
+{
+}
+
+void ModuleFilter::init()
{
ServerInstance->AddCommand(&filtcommand);
Implementation eventlist[] = { I_OnPreCommand, I_OnStats, I_OnSyncNetwork, I_OnDecodeMetaData, I_OnUserPreMessage, I_OnUserPreNotice, I_OnRehash };
}
}
std::string newrxengine = "regex/" + MyConf.ReadValue("filteropts", "engine", 0);
+ if (newrxengine == "regex/")
+ newrxengine = "regex";
if (RegexEngine.GetProvider() == newrxengine)
return;
RegexEngine.SetProvider(newrxengine);
if (!RegexEngine)
{
- ServerInstance->SNO->WriteGlobalSno('a', "WARNING: Regex engine '%s' is not loaded - Filter functionality disabled until this is corrected.", RegexEngine.GetProvider().c_str());
+ ServerInstance->SNO->WriteGlobalSno('a', "WARNING: Regex engine '%s' is not loaded - Filter functionality disabled until this is corrected.", newrxengine.c_str());
}
ReadFilters(MyConf);
}
Version ModuleFilter::GetVersion()
{
- return Version("Text (spam) filtering", VF_VENDOR | VF_COMMON);
+ return Version("Text (spam) filtering", VF_VENDOR | VF_COMMON, RegexEngine ? RegexEngine->name : "");
}