From bfc97ea14213c1ee9cb34386dfc33c0c1f665aca Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 10 Nov 2006 18:23:24 +0000 Subject: Implement on-burst synching of filters git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5669 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/extra/m_filter_pcre.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 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 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::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::iterator i = filters.begin(); i != filters.end(); i++) + { + this->SendFilter(proto, opaque, &(*i)); + } + } + virtual std::pair AddFilter(const std::string &freeform, const std::string &type, const std::string &reason, long duration) { for (std::vector::iterator i = filters.begin(); i != filters.end(); i++) { - if (i->pattern == freeform) + if (i->freeform == freeform) { return std::make_pair(false, "Filter already exists"); } -- cgit v1.2.3