ChanServ: add OWNER/PROTECT/HALFOP status commands
All checks were successful
CI / check (push) Successful in 3m47s
All checks were successful
CI / check (push) Successful in 3m47s
OWNER/DEOWNER (+q), PROTECT/DEPROTECT (+a, alias ADMIN), and HALFOP/DEHALFOP (+h) set the higher channel-status modes. They reuse the OP handler's target resolution and PEACE check; OWNER is founder-only, the rest need op access.
This commit is contained in:
parent
30e91bb295
commit
6e3a758cc1
3 changed files with 51 additions and 1 deletions
|
|
@ -9,7 +9,13 @@ pub fn handle(me: &str, from: &Sender, mode: &str, args: &[&str], ctx: &mut Serv
|
|||
ctx.notice(me, from.uid, "Syntax: OP/DEOP/VOICE/DEVOICE <#channel> [nick]");
|
||||
return;
|
||||
};
|
||||
if !super::require_op(me, from, chan, ctx, db) {
|
||||
// Granting owner (+q) is founder-only; op/halfop/protect need op access.
|
||||
let allowed = if mode.contains('q') {
|
||||
super::require_founder(me, from, chan, ctx, db)
|
||||
} else {
|
||||
super::require_op(me, from, chan, ctx, db)
|
||||
};
|
||||
if !allowed {
|
||||
return;
|
||||
}
|
||||
let target = match args.get(2) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue