sanick/svsnick: allow a case-only rename (in-use check matched the target itself)

This commit is contained in:
Jean Chevronnet 2026-08-17 14:52:38 +00:00
parent 8ed2003546
commit 480b5faea0

View file

@ -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,