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:
parent
ef89f97158
commit
020e9bd576
7 changed files with 213 additions and 12 deletions
17
modules/nickserv/glist.rs
Normal file
17
modules/nickserv/glist.rs
Normal 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"));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue