chanserv: SET SIGNKICK and PRIVATE (typed channel settings)

Introduce a typed ChanSettings struct + ChanSetting enum for ChanServ's on/off
options instead of a bag of string flags, so a new option is one field and the
compiler proves every site handles it. First two, both functional: SIGNKICK
attributes ChanServ kicks with who requested them; PRIVATE hides the channel
from LIST. Folded through the event log like the other channel state (node-local,
no gossip), shown in INFO. One ChannelSettingsSet event, one Store method.
This commit is contained in:
Jean Chevronnet 2026-07-13 02:54:46 +00:00
parent f388e3d650
commit 75019c867a
No known key found for this signature in database
7 changed files with 114 additions and 10 deletions

View file

@ -15,6 +15,10 @@ 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;
};
let reason = if args.len() > 3 { args[3..].join(" ") } else { "Kicked".to_string() };
let mut reason = if args.len() > 3 { args[3..].join(" ") } else { "Kicked".to_string() };
// SIGNKICK: attribute the kick to whoever asked for it.
if db.channel(chan).is_some_and(|c| c.signkick) {
reason = format!("{reason} (requested by {})", from.nick);
}
ctx.kick(me, chan, target, &reason);
}