nickserv: email confirmation (CONFIRM) on registration

When email is configured and a REGISTER includes an address, the account
starts unverified and a confirmation code is emailed. CONFIRM <code>
verifies it (a federated AccountVerified event); INFO shows an unconfirmed
email until then. Emailed codes now carry a purpose (reset vs confirm).
This commit is contained in:
Jean Chevronnet 2026-07-12 15:36:30 +00:00
parent a2957ffe02
commit fbcf0eaac7
No known key found for this signature in database
6 changed files with 140 additions and 20 deletions

View file

@ -13,7 +13,8 @@ pub fn handle(me: &str, from: &Sender, args: &[&str], ctx: &mut ServiceCtx, db:
ctx.notice(me, from.uid, format!(" Registered : {}", human_time(acct.ts)));
if from.account == Some(acct.name.as_str()) {
match &acct.email {
Some(email) => ctx.notice(me, from.uid, format!(" Email : {email}")),
Some(email) if acct.verified => ctx.notice(me, from.uid, format!(" Email : {email}")),
Some(email) => ctx.notice(me, from.uid, format!(" Email : {email} (unconfirmed)")),
None => ctx.notice(me, from.uid, " Email : (none set)"),
}
}