aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Sadie Powell2022-03-28 17:22:51 +0100
committerGravatar Sadie Powell2022-03-28 17:22:51 +0100
commite2b50c35511dcbbcdb5ede277ef1d7cb97252f6d (patch)
tree9590f2075e7db8b81a13b6263e945359fdc630ab
parentAdd support for matching against geolocation data with WHO. (diff)
Add the channels/ignore-chanfilter priv to the chanfilter module.
Closes #1971.
-rw-r--r--docs/conf/opers.conf.example1
-rw-r--r--src/modules/m_chanfilter.cpp11
2 files changed, 9 insertions, 3 deletions
diff --git a/docs/conf/opers.conf.example b/docs/conf/opers.conf.example
index cea965643..6629bb839 100644
--- a/docs/conf/opers.conf.example
+++ b/docs/conf/opers.conf.example
@@ -27,6 +27,7 @@
# - users/mass-message: allows opers with this priv to PRIVMSG and NOTICE to a server mask (e.g. NOTICE $*).
# - users/samode-usermodes: allows opers with this priv to change the user modes of any other user using /SAMODE.
# PERMISSIONS:
+ # - channels/ignore-chanfilter: allows opers with this priv to be immune to channel filters.
# - channels/ignore-delaymsg: allows opers with this priv to be immune to delaymsg restriction on a +d channel.
# - channels/ignore-noctcp: allows opers with this priv to send a CTCP to a +C channel.
# - channels/ignore-nonicks: allows opers with this priv to change their nick when on a +N channel.
diff --git a/src/modules/m_chanfilter.cpp b/src/modules/m_chanfilter.cpp
index 14735b13d..a2b643917 100644
--- a/src/modules/m_chanfilter.cpp
+++ b/src/modules/m_chanfilter.cpp
@@ -67,9 +67,14 @@ class ModuleChanFilter : public Module
ChanFilter::ListItem* Match(User* user, Channel* chan, const std::string& text)
{
- ModResult res = CheckExemption::Call(exemptionprov, user, chan, "filter");
- if (!IS_LOCAL(user) || res == MOD_RES_ALLOW)
- return NULL;
+ if (!IS_LOCAL(user))
+ return NULL; // We don't handle remote users.
+
+ if (user->HasPrivPermission("channels/ignore-chanfilter"))
+ return NULL; // The source is an exempt server operator.
+
+ if (CheckExemption::Call(exemptionprov, user, chan, "filter") == MOD_RES_ALLOW)
+ return NULL; // The source matches an exemptchanops entry.
ListModeBase::ModeList* list = cf.GetList(chan);
if (!list)