sanick/svsnick: allow a case-only rename (in-use check matched the target itself)
This commit is contained in:
parent
8ed2003546
commit
480b5faea0
1 changed files with 10 additions and 4 deletions
|
|
@ -443,8 +443,11 @@ impl Command for SaNick {
|
||||||
);
|
);
|
||||||
return CmdResult::Fail;
|
return CmdResult::Fail;
|
||||||
}
|
}
|
||||||
if s.find_nick(newnick).is_some()
|
// allow a case-only change: the in-use index would otherwise match the target itself
|
||||||
|| s.remote_nick.contains_key(&newnick.to_ascii_lowercase())
|
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(
|
s.numeric(
|
||||||
uid,
|
uid,
|
||||||
|
|
@ -493,8 +496,11 @@ impl Command for SvsNick {
|
||||||
);
|
);
|
||||||
return CmdResult::Fail;
|
return CmdResult::Fail;
|
||||||
}
|
}
|
||||||
if s.find_nick(newnick).is_some()
|
// allow a case-only change: the in-use index would otherwise match the target itself
|
||||||
|| s.remote_nick.contains_key(&newnick.to_ascii_lowercase())
|
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(
|
s.numeric(
|
||||||
uid,
|
uid,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue