summaryrefslogtreecommitdiff
path: root/src/modules/extra
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-05-28 22:19:26 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-05-28 22:19:26 +0000
commit5183b9b8207a26b6196b7da0a1d092bb1f6e8429 (patch)
tree6e9b14ba39f98d3e7694aeff4e6d0aca783cbaa0 /src/modules/extra
parent30904ef950c32e03c19aaae2399bcd3b8841b42a (diff)
Stuff for flags as requested by djGrr. We aren't going all-out rediculous amount of flags on this, we're sticking with the 5 or 6 easy to remember and lumping oper-immunity into the flags (see forums)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7178 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/extra')
-rw-r--r--src/modules/extra/m_filter_pcre.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/modules/extra/m_filter_pcre.cpp b/src/modules/extra/m_filter_pcre.cpp
index a347bcb57..bafb40070 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, bool operex)
- : FilterResult::FilterResult(pat, rea, act, gline_time, operex), regexp(r)
+ PCREFilter(pcre* r, const std::string &rea, const std::string &act, long gline_time, const std::string &pat, const std::string &flags)
+ : FilterResult::FilterResult(pat, rea, act, gline_time, flags), 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, bool operexception)
+ virtual std::pair<bool, std::string> AddFilter(const std::string &freeform, const std::string &type, const std::string &reason, long duration, const std::string &flags)
{
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, operexception));
+ filters.push_back(PCREFilter(re, reason, type, duration, freeform, flags));
return std::make_pair(true, "");
}
}
@@ -133,8 +133,7 @@ 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;
+ std::string flags = MyConf.ReadValue("keyword", "flags", index);
long gline_time = ServerInstance->Duration(MyConf.ReadValue("keyword", "duration", index).c_str());
re = pcre_compile(pattern.c_str(),0,&error,&erroffset,NULL);
@@ -146,7 +145,7 @@ class ModuleFilterPCRE : public FilterBase
}
else
{
- filters.push_back(PCREFilter(re, reason, action, gline_time, pattern, operexception));
+ filters.push_back(PCREFilter(re, reason, action, gline_time, pattern, flags));
ServerInstance->Log(DEFAULT,"Regular expression %s loaded.", pattern.c_str());
}
}