extban: learn the ircd live set from CAPAB EXTBANS and validate AKICK/MODE against what it actually offers

This commit is contained in:
Jean Chevronnet 2026-07-17 21:47:02 +00:00
parent da94142bad
commit c990eb1e1e
No known key found for this signature in database
8 changed files with 95 additions and 1 deletions

View file

@ -35,6 +35,10 @@ pub fn handle(me: &str, from: &Sender, args: &[&str], ctx: &mut ServiceCtx, db:
ctx.notice(me, from.uid, format!("\x02{name}\x02 isn't a host mask or a known extban."));
return;
}
echo_api::AkickMask::Ext(eb, _) if !db.extban_offered(eb.name) => {
ctx.notice(me, from.uid, format!("This network's ircd doesn't offer the \x02{}\x02 extban.", eb.name));
return;
}
echo_api::AkickMask::Ext(eb, _) if !db.extban_enabled(eb.name) => {
ctx.notice(me, from.uid, format!("The \x02{}\x02 extban isn't enabled on this network.", eb.name));
return;

View file

@ -28,6 +28,10 @@ pub fn handle(me: &str, from: &Sender, args: &[&str], ctx: &mut ServiceCtx, db:
for mask in ban_masks(&args[2..]) {
let core = mask.strip_prefix('!').unwrap_or(mask); // extbans may be inverted
if let echo_api::AkickMask::Ext(eb, _) = echo_api::AkickMask::parse(core) {
if !db.extban_offered(eb.name) {
ctx.notice(me, from.uid, format!("This network's ircd doesn't offer the \x02{}\x02 extban.", eb.name));
return;
}
if !db.extban_enabled(eb.name) {
ctx.notice(me, from.uid, format!("The \x02{}\x02 extban isn't enabled on this network.", eb.name));
return;