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:
parent
c4456cf002
commit
235c747c03
4 changed files with 35 additions and 13 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue