From bc520d59a5315394bac7e87ea46db907f2b45e6a Mon Sep 17 00:00:00 2001 From: reverse Date: Thu, 20 Aug 2026 14:17:15 +0000 Subject: [PATCH] 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 --- src/coremods/core_info.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/coremods/core_info.rs b/src/coremods/core_info.rs index 69be0bd..00b8191 100644 --- a/src/coremods/core_info.rs +++ b/src/coremods/core_info.rs @@ -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 {