nickserv: grouped nicks (GROUP/GLIST/UNGROUP) and GHOST

A nick can be grouped to an account and then identifies to it; the store
resolves an alias to its account everywhere it authenticates. GHOST (and
RECOVER) rename off a session using a nick you own. Grouped nicks
federate and are dropped with their account.
This commit is contained in:
Jean Chevronnet 2026-07-12 14:59:23 +00:00
parent ef89f97158
commit 020e9bd576
No known key found for this signature in database
7 changed files with 213 additions and 12 deletions

17
modules/nickserv/glist.rs Normal file
View file

@ -0,0 +1,17 @@
use crate::engine::db::Db;
use crate::engine::service::{Sender, ServiceCtx};
// GLIST: list the nicks grouped to your account.
pub fn handle(me: &str, from: &Sender, ctx: &mut ServiceCtx, db: &Db) {
let Some(account) = from.account else {
ctx.notice(me, from.uid, "You need to be logged in. Identify to NickServ first.");
return;
};
let mut nicks = db.grouped_nicks(account);
nicks.sort();
ctx.notice(me, from.uid, format!("Nicks grouped to \x02{account}\x02:"));
ctx.notice(me, from.uid, format!(" \x02{account}\x02 (main)"));
for n in nicks {
ctx.notice(me, from.uid, format!(" \x02{n}\x02"));
}
}