opertypes: oper classes + types — reusable capability classes and named roles (WHOIS title, auto usermodes/snomasks/vhost + level on oper-up, per-type command enforcement via on_pre_command); ships 5 built-in (helpop/globop/admin/servadmin/netadmin); oper blocks gain type=<id>; a typeless oper keeps full access
This commit is contained in:
parent
f3ce0e61ef
commit
01516d5fdc
6 changed files with 509 additions and 5 deletions
|
|
@ -298,12 +298,20 @@ impl Command for Whois {
|
|||
s.numeric(uid, RPL_WHOISCHANNELS, &format!("{nick} :{line}"));
|
||||
}
|
||||
}
|
||||
// 313: is an IRC operator (hidden by +H unless the asker is an oper)
|
||||
// 313: is a/an <oper type> (the type's title, else plain "IRC operator");
|
||||
// hidden by +H unless the asker is an oper.
|
||||
if oper && (!hideoper || asker_oper) {
|
||||
let title = crate::modules::opertypes::title_of(s, tuid)
|
||||
.unwrap_or_else(|| "IRC operator".to_string());
|
||||
let article = if title.chars().next().is_some_and(|c| "aeiouAEIOU".contains(c)) {
|
||||
"an"
|
||||
} else {
|
||||
"a"
|
||||
};
|
||||
s.numeric(
|
||||
uid,
|
||||
RPL_WHOISOPERATOR,
|
||||
&format!("{nick} :is an IRC operator"),
|
||||
&format!("{nick} :is {article} {title}"),
|
||||
);
|
||||
}
|
||||
// 320: oper-set SWHOIS line. No redundant target-nick param — just the
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue