summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-04-11 15:16:26 +0200
committerAttila Molnar <attilamolnar@hush.com>2014-04-11 15:16:26 +0200
commit477811faefa0a5b4e7d824eaae7a755bb0cf9517 (patch)
treeeb9ea145833138d85ea3edc6912bd5935146b19a
parent07c783c8b043f482b86912b816fdd9db3c41539c (diff)
m_filter Rename config key used in exemptfromfilter from "channel" to "target", but keep compatibility
-rw-r--r--docs/conf/filter.conf.example2
-rw-r--r--docs/conf/modules.conf.example2
-rw-r--r--docs/conf/modules/unrealircd.conf.example2
-rw-r--r--src/modules/m_filter.cpp9
4 files changed, 9 insertions, 6 deletions
diff --git a/docs/conf/filter.conf.example b/docs/conf/filter.conf.example
index 45e5d2853..c847c9838 100644
--- a/docs/conf/filter.conf.example
+++ b/docs/conf/filter.conf.example
@@ -57,4 +57,4 @@
# <keyword pattern="^blah.*?$" reason="Dont blah!" action="gline" duration="1d6h" flags="pnPq">
# An example of excluding a channel from filtering:
-# <exemptfromfilter channel="#help">
+#<exemptfromfilter target="#help">
diff --git a/docs/conf/modules.conf.example b/docs/conf/modules.conf.example
index b17fd73fb..5a6c80646 100644
--- a/docs/conf/modules.conf.example
+++ b/docs/conf/modules.conf.example
@@ -736,7 +736,7 @@
# Your choice of regex engine must match on all servers network-wide.
#
# You may specify specific channels that are exempt from being filtered:
-#<exemptfromfilter channel="#blah">
+#<exemptfromfilter target="#opers">
#
#-#-#-#-#-#-#-#-#-#-#- FILTER CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-#
# #
diff --git a/docs/conf/modules/unrealircd.conf.example b/docs/conf/modules/unrealircd.conf.example
index 2bda9d840..0bdec9a77 100644
--- a/docs/conf/modules/unrealircd.conf.example
+++ b/docs/conf/modules/unrealircd.conf.example
@@ -192,7 +192,7 @@
# Your choice of regex engine must match on all servers network-wide.
#
# You may specify specific channels that are exempt from being filtered:
-#<exemptfromfilter channel="#blah">
+#<exemptfromfilter target="#opers">
#
#-#-#-#-#-#-#-#-#-#-#- FILTER CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-#
# #
diff --git a/src/modules/m_filter.cpp b/src/modules/m_filter.cpp
index e594160f4..1e9b094f0 100644
--- a/src/modules/m_filter.cpp
+++ b/src/modules/m_filter.cpp
@@ -446,9 +446,12 @@ void ModuleFilter::ReadConfig(ConfigStatus& status)
exemptedchans.clear();
for (ConfigIter i = tags.first; i != tags.second; ++i)
{
- std::string chan = i->second->getString("channel");
- if (!chan.empty())
- exemptedchans.insert(chan);
+ ConfigTag* tag = i->second;
+
+ // If "target" is not found, try the old "channel" key to keep compatibility with 2.0 configs
+ const std::string target = tag->getString("target", tag->getString("channel"));
+ if (!target.empty())
+ exemptedchans.insert(target);
}
std::string newrxengine = ServerInstance->Config->ConfValue("filteropts")->getString("engine");