registration: add a Hold verdict so captcha/challenge modules pend the client for the challenge instead of tearing the link down

This commit is contained in:
Jean Chevronnet 2026-08-17 19:06:17 +00:00
parent 99eb9c74f3
commit 4b86de3b62
4 changed files with 23 additions and 9 deletions

View file

@ -545,13 +545,19 @@ impl Ircd {
fn complete_registration(&mut self, uid: Uid) {
for m in &mut self.modules {
if m.on_user_register(&mut self.server, uid) == ModResult::Deny {
self.server.send(
uid,
"ERROR :Closing link (registration refused)".to_string(),
);
self.server.remove_user(uid, "Registration refused");
return;
match m.on_user_register(&mut self.server, uid) {
ModResult::Deny => {
self.server.send(
uid,
"ERROR :Closing link (registration refused)".to_string(),
);
self.server.remove_user(uid, "Registration refused");
return;
}
// a challenge is pending: keep the connection, don't welcome yet.
// A later command (the CAPTCHA/VERIFYCHALLENGE reply) re-runs this.
ModResult::Hold => return,
_ => {}
}
}
// x-line: refuse a banned host / ip before welcoming