From 59b0439b795758b5d40a49bc6d405c1faf1b5885 Mon Sep 17 00:00:00 2001 From: reverse Date: Sat, 15 Aug 2026 17:17:12 +0000 Subject: [PATCH] whois: append the snomask to the 379 modes line for opers (is using modes +), matching the standard format --- src/coremods/core_info.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/coremods/core_info.rs b/src/coremods/core_info.rs index 6daf170..f2ee0f0 100644 --- a/src/coremods/core_info.rs +++ b/src/coremods/core_info.rs @@ -292,14 +292,20 @@ impl Command for Whois { &format!("{nick} :is a registered nick"), ); } - // 379: the user's active modes — visible to opers and to the user themselves + // 379: the user's active modes — visible to opers and to the user themselves. + // When they carry a snomask (+s), it's appended as a second token. if is_self || asker_oper { - let modes = s + let (modes, sno) = s .users .get(&tuid) - .map(|u| u.flags.umodes()) + .map(|u| (u.flags.umodes(), u.flags.snomask_cats.clone())) .unwrap_or_default(); - s.numeric(uid, RPL_WHOISMODES, &format!("{nick} :is using modes {modes}")); + let line = if sno.is_empty() { + format!("{nick} :is using modes {modes}") + } else { + format!("{nick} :is using modes {modes} +{sno}") + }; + s.numeric(uid, RPL_WHOISMODES, &line); } // 330: logged in to a services account if let Some(acct) = &account {