nickserv: AJOIN auto-join list

Adds the account auto-join list (AJOIN ADD/DEL/LIST): NickServ SVSJOINs you
into your listed channels each time you identify. The list is a typed
Vec<AjoinEntry> on the account, folded through the event log like the cert and
akick lists (persists and replays; no separate store), reached by modules
through the Store trait. New ForceJoin action serialises to InspIRCd SVSJOIN.
Shown in INFO. Operates on the caller's own account; the oper form for other
users waits on a privilege system.
This commit is contained in:
Jean Chevronnet 2026-07-13 02:09:03 +00:00
parent e0bb3a1fea
commit 75ba9b35b4
No known key found for this signature in database
9 changed files with 211 additions and 5 deletions

View file

@ -254,6 +254,15 @@ impl Protocol for InspIrcd {
let now = SystemTime::now().duration_since(UNIX_EPOCH).map(|d| d.as_secs()).unwrap_or(self.ts);
vec![self.from_us(format!("SVSNICK {} {} {}", uid, nick, now))]
}
// SVSJOIN <uid> <chan> [key]: force a user into a channel, sourced from
// the services server. Used to apply an account's auto-join list.
NetAction::ForceJoin { uid, channel, key } => {
if key.is_empty() {
vec![self.from_us(format!("SVSJOIN {} {}", uid, channel))]
} else {
vec![self.from_us(format!("SVSJOIN {} {} {}", uid, channel, key))]
}
}
// FMODE <chan> <ts> <modes>. The ircd drops an FMODE whose TS is newer
// than the channel's, so we send TS 1 to guarantee it applies. Sourced
// from the given pseudoclient (e.g. ChanServ) so users see who set it,