summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-04-11 15:10:03 +0200
committerAttila Molnar <attilamolnar@hush.com>2014-04-11 15:10:03 +0200
commit07c783c8b043f482b86912b816fdd9db3c41539c (patch)
tree552245de6fbcb01067d956117fdaf41fa0b92285
parent46f6342c5c1b70e5926a3dfc49d2c00eb0b39563 (diff)
m_filter Rename exemptfromfilter field to exemptedchans, use std::set::count()
-rw-r--r--src/modules/m_filter.cpp12
1 files 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::vector<std::stri
if (parameters.size() < 2)
return MOD_RES_PASSTHRU;
- if (exemptfromfilter.find(parameters[0]) != exemptfromfilter.end())
+ if (exemptedchans.count(parameters[0]))
return MOD_RES_PASSTHRU;
parting = true;
@@ -443,12 +443,12 @@ ModResult ModuleFilter::OnPreCommand(std::string &command, std::vector<std::stri
void ModuleFilter::ReadConfig(ConfigStatus& status)
{
ConfigTagList tags = ServerInstance->Config->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));
}