summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2024-04-05 14:06:24 +0100
committerSadie Powell <sadie@witchery.services>2024-04-05 14:14:10 +0100
commit4603cd467b01a507b930c365ab366de4d8a6f5a4 (patch)
treecd435217e8a4067674b6ee69c525dfd2433a2b0f
parent00549bc9b2a4e377ad309b1ecd241057ac84b250 (diff)
Add an operator privilege to allow overriding drop codes.
Closes #392
-rw-r--r--data/anope.example.conf2
-rw-r--r--modules/chanserv/cs_drop.cpp2
-rw-r--r--modules/nickserv/ns_drop.cpp2
3 files changed, 4 insertions, 2 deletions
diff --git a/data/anope.example.conf b/data/anope.example.conf
index dfa144b04..87e199564 100644
--- a/data/anope.example.conf
+++ b/data/anope.example.conf
@@ -756,6 +756,7 @@ log
* chanserv/auspex - Can see any information with /CHANSERV INFO
* chanserv/no-register-limit - May register an unlimited number of channels and nicknames
* chanserv/kick - Can kick and ban users from channels through ChanServ
+ * chanserv/drop/override - Allows dropping channels without using a confirmation code
* memoserv/info - Can see any information with /MEMOSERV INFO
* memoserv/set-limit - Can set the limit of max stored memos on any user and channel
* memoserv/no-limit - Can send memos through limits and throttles
@@ -764,6 +765,7 @@ log
* nickserv/cert - Can modify other users certificate lists
* nickserv/confirm - Can confirm other users nicknames
* nickserv/drop - Can drop other users nicks
+ * nickserv/drop/override - Allows dropping nicks without using a confirmation code
* nickserv/recover - Can recover other users nicks
* operserv/config - Can modify services's configuration
* operserv/oper/modify - Can add and remove operators with at most the same privileges
diff --git a/modules/chanserv/cs_drop.cpp b/modules/chanserv/cs_drop.cpp
index 89e996970..1db7826d0 100644
--- a/modules/chanserv/cs_drop.cpp
+++ b/modules/chanserv/cs_drop.cpp
@@ -50,7 +50,7 @@ public:
}
auto *code = dropcode.Get(ci);
- if (params.size() < 2 || !code || !code->equals_ci(params[1]))
+ if (params.size() < 2 || ((!code || !code->equals_ci(params[1])) && (!source.HasPriv("chanserv/drop/override") || params[1] != "override")))
{
if (!code)
{
diff --git a/modules/nickserv/ns_drop.cpp b/modules/nickserv/ns_drop.cpp
index 28a8e87cf..da8211014 100644
--- a/modules/nickserv/ns_drop.cpp
+++ b/modules/nickserv/ns_drop.cpp
@@ -58,7 +58,7 @@ public:
}
auto *code = dropcode.Get(na);
- if (params.size() < 2 || !code || !code->equals_ci(params[1]))
+ if (params.size() < 2 || ((!code || !code->equals_ci(params[1])) && (!source.HasPriv("nickserv/drop/override") || params[1] != "override")))
{
if (!code)
{