summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Schatz <genius3000@g3k.solutions>2019-03-13 03:04:13 -0600
committerPeter Powell <petpow@saberuk.com>2019-03-14 00:55:18 +0000
commit5f2ecf00132433c875c78b475ea46c8b73bf5f57 (patch)
treeb4cc801c15f80c3297596ab1fee91eb8aaea8820
parentd57cad7896a4e9f78565d998e3fbd98b0b32c94e (diff)
Add oper privs to allow overriding noctcp.
-rw-r--r--docs/conf/opers.conf.example2
-rw-r--r--src/modules/m_noctcp.cpp6
2 files changed, 8 insertions, 0 deletions
diff --git a/docs/conf/opers.conf.example b/docs/conf/opers.conf.example
index c5edb9cb2..f9f6a75d4 100644
--- a/docs/conf/opers.conf.example
+++ b/docs/conf/opers.conf.example
@@ -27,12 +27,14 @@
# - 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-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.
# - channels/restricted-create: allows opers with this priv to create channels if the restrictchans module is loaded.
# - users/flood/no-fakelag: prevents opers from being penalized with fake lag for flooding (*NOTE).
# - users/flood/no-throttle: allows opers with this priv to send commands without being throttled (*NOTE).
# - users/flood/increased-buffers: allows opers with this priv to send and receive data without worrying about being disconnected for exceeding limits (*NOTE).
# - users/callerid-override: allows opers with this priv to message people using callerid without being on their callerid list.
+ # - users/ignore-noctcp: allows opers with this priv to send a CTCP to a +T user.
# - users/sajoin-others: allows opers with this priv to /SAJOIN users other than themselves.
# - servers/use-disabled-commands: allows opers with this priv to use disabled commands.
# - servers/use-disabled-modes: allows opers with this priv to use disabled modes.
diff --git a/src/modules/m_noctcp.cpp b/src/modules/m_noctcp.cpp
index 3a57dc184..13b132eb3 100644
--- a/src/modules/m_noctcp.cpp
+++ b/src/modules/m_noctcp.cpp
@@ -63,6 +63,9 @@ class ModuleNoCTCP : public Module
if (target.type == MessageTarget::TYPE_CHANNEL)
{
+ if (user->HasPrivPermission("channels/ignore-noctcp"))
+ return MOD_RES_PASSTHRU;
+
Channel* c = target.Get<Channel>();
ModResult res = CheckExemption::Call(exemptionprov, user, c, "noctcp");
if (res == MOD_RES_ALLOW)
@@ -76,6 +79,9 @@ class ModuleNoCTCP : public Module
}
else if (target.type == MessageTarget::TYPE_USER)
{
+ if (user->HasPrivPermission("users/ignore-noctcp"))
+ return MOD_RES_PASSTHRU;
+
User* u = target.Get<User>();
if (u->IsModeSet(ncu))
{