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:
Jean Chevronnet 2026-08-20 14:17:15 +00:00
parent 8f9e60c8e2
commit bc520d59a5
No known key found for this signature in database
GPG key ID: 439666D63A9477E4

View file

@ -308,6 +308,18 @@ impl Command for Whois {
&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
// text — so clients that don't special-case 320 don't echo the nick.
if let Some(line) = &swhois {