summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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");