summaryrefslogtreecommitdiff
path: root/src/modules/extra
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-11-10 18:23:24 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-11-10 18:23:24 +0000
commitbfc97ea14213c1ee9cb34386dfc33c0c1f665aca (patch)
tree796773deb96bd44171a9b01310259174c6cde4e8 /src/modules/extra
parent745994473896e59faa59e4caf3fb621ef974419a (diff)
Implement on-burst synching of filters
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5669 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/extra')
-rw-r--r--src/modules/extra/m_filter_pcre.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/modules/extra/m_filter_pcre.cpp b/src/modules/extra/m_filter_pcre.cpp
index 14b4d6d4a..dde7575ab 100644
--- a/src/modules/extra/m_filter_pcre.cpp
+++ b/src/modules/extra/m_filter_pcre.cpp
@@ -36,10 +36,9 @@ class PCREFilter : public FilterResult
{
public:
pcre* regexp;
- std::string pattern;
PCREFilter(pcre* r, const std::string &rea, const std::string &act, long gline_time, const std::string &pat)
- : FilterResult::FilterResult(rea, act, gline_time), regexp(r), pattern(pat)
+ : FilterResult::FilterResult(pat, rea, act, gline_time), regexp(r)
{
}
};
@@ -80,7 +79,7 @@ class ModuleFilterPCRE : public FilterBase
{
for (std::vector<PCREFilter>::iterator i = filters.begin(); i != filters.end(); i++)
{
- if (i->pattern == freeform)
+ if (i->freeform == freeform)
{
filters.erase(i);
return true;
@@ -89,11 +88,19 @@ class ModuleFilterPCRE : public FilterBase
return false;
}
+ virtual void SyncFilters(Module* proto, void* opaque)
+ {
+ for (std::vector<PCREFilter>::iterator i = filters.begin(); i != filters.end(); i++)
+ {
+ this->SendFilter(proto, opaque, &(*i));
+ }
+ }
+
virtual std::pair<bool, std::string> AddFilter(const std::string &freeform, const std::string &type, const std::string &reason, long duration)
{
for (std::vector<PCREFilter>::iterator i = filters.begin(); i != filters.end(); i++)
{
- if (i->pattern == freeform)
+ if (i->freeform == freeform)
{
return std::make_pair(false, "Filter already exists");
}