server: carry accepted_nicks count across a nick change — set_nick rewrites ACCEPT entries old->new in place (bypassing accept_add/remove) so the reverse count desynced; the count-gated quit scrub could then skip a reused nick, letting it inherit +g acceptance. move the count old->new (also fixes a slow map leak)
This commit is contained in:
parent
155e804779
commit
9eda8cbd4f
1 changed files with 7 additions and 0 deletions
|
|
@ -404,6 +404,13 @@ impl Server {
|
|||
}
|
||||
}
|
||||
}
|
||||
// carry the accepted-nick reverse count across the rename (the number of
|
||||
// acceptors doesn't change when the accepted user renames), so the
|
||||
// count-gated quit scrub stays correct — otherwise a reused old nick could
|
||||
// inherit acceptance and bypass +g, and the old-nick count would leak.
|
||||
if let Some(c) = self.accepted_nicks.remove(&oldlow) {
|
||||
*self.accepted_nicks.entry(newlow.clone()).or_insert(0) += c;
|
||||
}
|
||||
}
|
||||
if registered {
|
||||
let line = format!(":{prefix} NICK :{newnick}");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue