chanserv: SET PEACE (block acting against equal-or-higher access)

PEACE stops a channel op from using ChanServ KICK/BAN/DEOP/DEVOICE against
someone whose access rank (founder>op>voice) is equal to or above their own.
Adds a typed access_rank on ChannelView and a peace_blocks guard in those
commands. Same typed-settings path as SIGNKICK/PRIVATE; shown in INFO.
This commit is contained in:
Jean Chevronnet 2026-07-13 03:06:58 +00:00
parent 75019c867a
commit 3bf6b2be77
No known key found for this signature in database
7 changed files with 62 additions and 2 deletions

View file

@ -15,6 +15,9 @@ pub fn handle(me: &str, from: &Sender, args: &[&str], ctx: &mut ServiceCtx, net:
ctx.notice(me, from.uid, format!("\x02{nick}\x02 isn't here."));
return;
};
if super::peace_blocks(me, from, chan, &target, ctx, net, db) {
return;
}
let host = net.host_of(&target).unwrap_or("*");
ctx.channel_mode(me, chan, &format!("+b *!*@{host}"));
let reason = if args.len() > 3 { args[3..].join(" ") } else { "Banned".to_string() };