whois: a typed oper gets its own 320 special line with the type title (e.g. 'is a Network Administrator'), separate from the generic 313 operator line
This commit is contained in:
parent
8f9e60c8e2
commit
bc520d59a5
1 changed files with 12 additions and 0 deletions
|
|
@ -308,6 +308,18 @@ impl Command for Whois {
|
||||||
&format!("{nick} :is an IRC Operator"),
|
&format!("{nick} :is an IRC Operator"),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
// 320: the oper type's title on its own line, e.g. "is a Network
|
||||||
|
// Administrator" — from the oper's type (hidden with +H like the 313 line).
|
||||||
|
if oper && (!hideoper || asker_oper) {
|
||||||
|
if let Some(title) = crate::modules::opertypes::title_of(s, tuid) {
|
||||||
|
let article = if title.chars().next().is_some_and(|c| "aeiouAEIOU".contains(c)) {
|
||||||
|
"an"
|
||||||
|
} else {
|
||||||
|
"a"
|
||||||
|
};
|
||||||
|
s.numeric(uid, RPL_WHOISSPECIAL, &format!(":is {article} {title}"));
|
||||||
|
}
|
||||||
|
}
|
||||||
// 320: oper-set SWHOIS line. No redundant target-nick param — just the
|
// 320: oper-set SWHOIS line. No redundant target-nick param — just the
|
||||||
// text — so clients that don't special-case 320 don't echo the nick.
|
// text — so clients that don't special-case 320 don't echo the nick.
|
||||||
if let Some(line) = &swhois {
|
if let Some(line) = &swhois {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue