From 30904ef950c32e03c19aaae2399bcd3b8841b42a Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 28 May 2007 20:30:51 +0000 Subject: A flags section for filters. Do not use yet. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7177 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/extra/m_filter_pcre.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/modules/extra') diff --git a/src/modules/extra/m_filter_pcre.cpp b/src/modules/extra/m_filter_pcre.cpp index b21ec12a5..a347bcb57 100644 --- a/src/modules/extra/m_filter_pcre.cpp +++ b/src/modules/extra/m_filter_pcre.cpp @@ -28,8 +28,8 @@ class PCREFilter : public FilterResult public: pcre* regexp; - PCREFilter(pcre* r, const std::string &rea, const std::string &act, long gline_time, const std::string &pat) - : FilterResult::FilterResult(pat, rea, act, gline_time), regexp(r) + PCREFilter(pcre* r, const std::string &rea, const std::string &act, long gline_time, const std::string &pat, bool operex) + : FilterResult::FilterResult(pat, rea, act, gline_time, operex), regexp(r) { } @@ -97,7 +97,7 @@ class ModuleFilterPCRE : public FilterBase } } - virtual std::pair AddFilter(const std::string &freeform, const std::string &type, const std::string &reason, long duration) + virtual std::pair AddFilter(const std::string &freeform, const std::string &type, const std::string &reason, long duration, bool operexception) { for (std::vector::iterator i = filters.begin(); i != filters.end(); i++) { @@ -117,7 +117,7 @@ class ModuleFilterPCRE : public FilterBase } else { - filters.push_back(PCREFilter(re, reason, type, duration, freeform)); + filters.push_back(PCREFilter(re, reason, type, duration, freeform, operexception)); return std::make_pair(true, ""); } } @@ -133,6 +133,8 @@ class ModuleFilterPCRE : public FilterBase std::string pattern = MyConf.ReadValue("keyword", "pattern", index); std::string reason = MyConf.ReadValue("keyword", "reason", index); std::string action = MyConf.ReadValue("keyword", "action", index); + // = MyConf.ReadFlag("keyword", "flags") + bool operexception = false; long gline_time = ServerInstance->Duration(MyConf.ReadValue("keyword", "duration", index).c_str()); re = pcre_compile(pattern.c_str(),0,&error,&erroffset,NULL); @@ -144,7 +146,7 @@ class ModuleFilterPCRE : public FilterBase } else { - filters.push_back(PCREFilter(re, reason, action, gline_time, pattern)); + filters.push_back(PCREFilter(re, reason, action, gline_time, pattern, operexception)); ServerInstance->Log(DEFAULT,"Regular expression %s loaded.", pattern.c_str()); } } -- cgit v1.2.3