NickServ GETEMAIL + ChanServ SET RESTRICTED
All checks were successful
CI / check (push) Successful in 3m51s

GETEMAIL (auspex) lists accounts whose email matches a glob. SET
RESTRICTED makes a channel kick anyone without access (or oper) as they
join, mirroring the SECUREOPS on-join enforcement.
This commit is contained in:
Jean Chevronnet 2026-07-15 19:25:41 +00:00
parent be4860c9a8
commit 53d3d63464
No known key found for this signature in database
10 changed files with 107 additions and 2 deletions

View file

@ -0,0 +1,19 @@
use echo_api::{Priv, Sender, ServiceCtx, Store};
// GETEMAIL <email>: list accounts registered with a matching email. Oper-only.
pub fn handle(me: &str, from: &Sender, args: &[&str], ctx: &mut ServiceCtx, db: &dyn Store) {
if !from.privs.has(Priv::Auspex) {
ctx.notice(me, from.uid, "Access denied — GETEMAIL needs the \x02auspex\x02 privilege.");
return;
}
let Some(&pattern) = args.get(1) else {
ctx.notice(me, from.uid, "Syntax: GETEMAIL <email>");
return;
};
let accounts = db.accounts_by_email(pattern);
if accounts.is_empty() {
ctx.notice(me, from.uid, format!("No accounts use an email matching \x02{pattern}\x02."));
return;
}
ctx.notice(me, from.uid, format!("Accounts with email matching \x02{pattern}\x02: {}", accounts.join(", ")));
}