summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2025-04-22 22:53:40 +0100
committerSadie Powell <sadie@witchery.services>2025-04-22 22:53:40 +0100
commit095ed3c8c8774e46a90e2cbab50f5965caf5b6c7 (patch)
tree605d758046748044bc08575d8642acdd791b17e3 /modules
parentf3743cd37dd1efb2d31f2d8aa3d489df68909c84 (diff)
Allow users to unmark themselves as a channel successor.
Closes #501.
Diffstat (limited to 'modules')
-rw-r--r--modules/chanserv/cs_set.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/modules/chanserv/cs_set.cpp b/modules/chanserv/cs_set.cpp
index b2287988a..c77d2d675 100644
--- a/modules/chanserv/cs_set.cpp
+++ b/modules/chanserv/cs_set.cpp
@@ -949,7 +949,15 @@ public:
if (MOD_RESULT == EVENT_STOP)
return;
- if (MOD_RESULT != EVENT_ALLOW && (ci->HasExt("SECUREFOUNDER") ? !source.IsFounder(ci) : !source.AccessFor(ci).HasPriv("FOUNDER")) && source.permission.empty() && !source.HasPriv("chanserv/administration"))
+ auto can_set_successor = ci->HasExt("SECUREFOUNDER")
+ ? source.IsFounder(ci)
+ : source.AccessFor(ci).HasPriv("FOUNDER");
+
+ // Special case: users can remove themselves as successor with no other privs.
+ if (param.empty() && source.GetAccount() && source.GetAccount() == ci->GetSuccessor())
+ can_set_successor = true;
+
+ if (MOD_RESULT != EVENT_ALLOW && !can_set_successor && source.permission.empty() && !source.HasPriv("chanserv/administration"))
{
source.Reply(ACCESS_DENIED);
return;