From 07c783c8b043f482b86912b816fdd9db3c41539c Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Fri, 11 Apr 2014 15:10:03 +0200 Subject: m_filter Rename exemptfromfilter field to exemptedchans, use std::set::count() --- src/modules/m_filter.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/modules/m_filter.cpp b/src/modules/m_filter.cpp index 6d19d68ef..e594160f4 100644 --- a/src/modules/m_filter.cpp +++ b/src/modules/m_filter.cpp @@ -170,7 +170,7 @@ class ModuleFilter : public Module int flags; // List of channel names excluded from filtering. - ExemptTargetSet exemptfromfilter; + ExemptTargetSet exemptedchans; ModuleFilter(); CullResult cull(); @@ -327,7 +327,7 @@ ModResult ModuleFilter::OnUserPreMessage(User* user, void* dest, int target_type else if (target_type == TYPE_CHANNEL) { Channel* t = (Channel*)dest; - if (exemptfromfilter.find(t->name) != exemptfromfilter.end()) + if (exemptedchans.count(t->name)) return MOD_RES_PASSTHRU; target = t->name; @@ -390,7 +390,7 @@ ModResult ModuleFilter::OnPreCommand(std::string &command, std::vectorConfig->ConfTags("exemptfromfilter"); - exemptfromfilter.clear(); + exemptedchans.clear(); for (ConfigIter i = tags.first; i != tags.second; ++i) { std::string chan = i->second->getString("channel"); if (!chan.empty()) - exemptfromfilter.insert(chan); + exemptedchans.insert(chan); } std::string newrxengine = ServerInstance->Config->ConfValue("filteropts")->getString("engine"); @@ -684,7 +684,7 @@ ModResult ModuleFilter::OnStats(char symbol, User* user, string_list &results) { results.push_back("223 "+user->nick+" :"+RegexEngine.GetProvider()+":"+i->freeform+" "+i->GetFlags()+" "+FilterActionToString(i->action)+" "+ConvToStr(i->gline_time)+" :"+i->reason); } - for (ExemptTargetSet::const_iterator i = exemptfromfilter.begin(); i != exemptfromfilter.end(); ++i) + for (ExemptTargetSet::const_iterator i = exemptedchans.begin(); i != exemptedchans.end(); ++i) { results.push_back("223 "+user->nick+" :EXEMPT "+(*i)); } -- cgit v1.2.3