NickServ: add UPDATE and LIST
All checks were successful
CI / check (push) Successful in 3m46s

UPDATE re-applies your auto-joins and vhost and re-checks for waiting
memos without re-identifying. LIST (auspex-gated) shows registered
accounts matching a glob, capped at 100. Adds an accounts_matching store
method.
This commit is contained in:
Jean Chevronnet 2026-07-15 18:24:52 +00:00
parent 959d085e7a
commit 21efbd32c1
No known key found for this signature in database
6 changed files with 91 additions and 0 deletions

View file

@ -0,0 +1,21 @@
use echo_api::{Sender, ServiceCtx, Store};
// UPDATE: re-apply your account's auto-joins and vhost, and re-check for waiting
// memos, without having to re-identify.
pub fn handle(me: &str, from: &Sender, ctx: &mut ServiceCtx, db: &dyn Store) {
let Some(account) = from.account else {
ctx.notice(me, from.uid, "You need to be logged in. Identify to NickServ first.");
return;
};
for entry in db.ajoin_list(account) {
ctx.force_join(from.uid, &entry.channel, &entry.key);
}
if let Some(v) = db.vhost(account) {
ctx.apply_vhost(from.uid, &v.host);
}
let unread = db.unread_memos(account);
if unread > 0 {
ctx.notice(me, from.uid, format!("You have \x02{unread}\x02 new memo(s). Read them with \x02/msg MemoServ READ NEW\x02."));
}
ctx.notice(me, from.uid, "Your status has been refreshed.");
}