summaryrefslogtreecommitdiff
path: root/src/modules/extra
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-05-28 20:30:51 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-05-28 20:30:51 +0000
commit30904ef950c32e03c19aaae2399bcd3b8841b42a (patch)
tree171a4e03ed90de93fb33f69b9ba679d6999c7838 /src/modules/extra
parentd12b1c4897cc90ba390d876c281cacbbfd91cbc1 (diff)
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
Diffstat (limited to 'src/modules/extra')
-rw-r--r--src/modules/extra/m_filter_pcre.cpp12
1 files changed, 7 insertions, 5 deletions
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<bool, std::string> AddFilter(const std::string &freeform, const std::string &type, const std::string &reason, long duration)
+ virtual std::pair<bool, std::string> AddFilter(const std::string &freeform, const std::string &type, const std::string &reason, long duration, bool operexception)
{
for (std::vector<PCREFilter>::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());
}
}