nickserv: log out the loser of a registration conflict

When a peer's registration wins a name a local session was logged into,
that session authenticated against a credential that no longer exists.
The node now clears its accountname (the ircd emits RPL_LOGGEDOUT) and
tells the user why. A new outbound channel lets the engine push these
services-initiated actions to the uplink from the gossip path, drained
by the link loop alongside incoming traffic.
This commit is contained in:
Jean Chevronnet 2026-07-12 13:34:38 +00:00
parent f46662db90
commit aab64baf86
No known key found for this signature in database
7 changed files with 164 additions and 33 deletions

View file

@ -81,6 +81,15 @@ impl Network {
self.accounts.get(uid).map(String::as_str)
}
// Uids of every live session currently identified to `account`.
pub fn uids_logged_into(&self, account: &str) -> Vec<String> {
self.accounts
.iter()
.filter(|(_, a)| a.eq_ignore_ascii_case(account))
.map(|(uid, _)| uid.clone())
.collect()
}
pub fn set_account(&mut self, uid: &str, account: &str) {
self.accounts.insert(uid.to_string(), account.to_string());
}