NICKLOCK / NICKUNLOCK (services hold a user's nick)

This commit is contained in:
Jean Chevronnet 2026-08-09 01:09:46 +00:00
parent 4d6525cac2
commit e2a4a3e248
3 changed files with 95 additions and 0 deletions

View file

@ -353,6 +353,20 @@ impl Command for Nick {
);
return CmdResult::Fail;
}
// NICKLOCK: a services-held nick can't be changed by the user (opers bypass)
if s.users
.get(&uid)
.map(|u| u.flags.nick_locked)
.unwrap_or(false)
&& !s.is_oper(uid)
{
s.numeric(
uid,
ERR_CANTCHANGENICK,
":Your nickname is locked and cannot be changed",
);
return CmdResult::Fail;
}
// Q-line: a reserved nick is refused (opers and services bypass)
if !s.is_oper(uid) {
if let Some(reason) = s.matched_qline(newnick) {