refactor: WEBIRC gateways and +G censor rules are named structs (WebircGateway/CensorRule) instead of positional tuples — self-documenting field access, no (_, g, _) index guessing; extends the OperBlock pattern

This commit is contained in:
Jean Chevronnet 2026-08-18 23:31:21 +00:00
parent c4456cf002
commit 235c747c03
4 changed files with 35 additions and 13 deletions

View file

@ -102,8 +102,8 @@ impl Command for WebIrc {
let Some(gw) = s
.webirc
.iter()
.find(|(p, _, mask)| p == pass && (mask.is_empty() || glob_match(mask, &from)))
.map(|(_, g, _)| g.clone())
.find(|g| g.password == *pass && (g.ipmask.is_empty() || glob_match(&g.ipmask, &from)))
.map(|g| g.name.clone())
else {
s.notice_star(uid, "WEBIRC: invalid credentials");
return CmdResult::Fail;