nickserv: IDENTIFY reports an unregistered account distinctly

A failed IDENTIFY now says whether the account isn't registered or the
password was wrong, instead of one message for both.
This commit is contained in:
Jean Chevronnet 2026-07-12 12:38:09 +00:00
parent 914c3874ce
commit 4408281d20
No known key found for this signature in database
2 changed files with 12 additions and 0 deletions

View file

@ -50,6 +50,12 @@ impl Service for NickServ {
return;
}
};
// Distinguish an unregistered account from a wrong password, so a
// failed login says which it was.
if !db.exists(account_name) {
ctx.notice(me, from.uid, format!("\x02{account_name}\x02 isn't registered."));
return;
}
match db.authenticate(account_name, password) {
Some(account) => {
// Already identified to this account: don't re-fire the login.