From 480b5faea0d4a5023d00e3b99e08b0b856f9f2c8 Mon Sep 17 00:00:00 2001 From: reverse Date: Mon, 17 Aug 2026 14:52:38 +0000 Subject: [PATCH] sanick/svsnick: allow a case-only rename (in-use check matched the target itself) --- src/coremods/core_oper.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/coremods/core_oper.rs b/src/coremods/core_oper.rs index 177a2cb..c26b6e9 100644 --- a/src/coremods/core_oper.rs +++ b/src/coremods/core_oper.rs @@ -443,8 +443,11 @@ impl Command for SaNick { ); return CmdResult::Fail; } - if s.find_nick(newnick).is_some() - || s.remote_nick.contains_key(&newnick.to_ascii_lowercase()) + // allow a case-only change: the in-use index would otherwise match the target itself + let cur = s.users.get(&tuid).map(|u| u.nick.clone()).unwrap_or_default(); + if !newnick.eq_ignore_ascii_case(&cur) + && (s.find_nick(newnick).is_some() + || s.remote_nick.contains_key(&newnick.to_ascii_lowercase())) { s.numeric( uid, @@ -493,8 +496,11 @@ impl Command for SvsNick { ); return CmdResult::Fail; } - if s.find_nick(newnick).is_some() - || s.remote_nick.contains_key(&newnick.to_ascii_lowercase()) + // allow a case-only change: the in-use index would otherwise match the target itself + let cur = s.users.get(&tuid).map(|u| u.nick.clone()).unwrap_or_default(); + if !newnick.eq_ignore_ascii_case(&cur) + && (s.find_nick(newnick).is_some() + || s.remote_nick.contains_key(&newnick.to_ascii_lowercase())) { s.numeric( uid,