Add NickServ LOGOUT command

Clears the account (RPL_LOGGEDOUT) and renames the user to a
configurable guest nick (default Guest) via SVSNICK.
This commit is contained in:
Jean Chevronnet 2026-07-12 05:06:34 +00:00
parent a382ac8ad3
commit 60fc687162
No known key found for this signature in database
7 changed files with 77 additions and 2 deletions

View file

@ -2,6 +2,7 @@
// sequence in Network-Links (protocols/inspircd.py); mode/burst details get
// firmed up against a live insp4 uplink.
use super::{NetAction, NetEvent, Protocol};
use std::time::{SystemTime, UNIX_EPOCH};
pub struct InspIrcd {
sid: String,
@ -163,6 +164,12 @@ impl Protocol for InspIrcd {
NetAction::Metadata { target, key, value } => {
vec![self.from_us(format!("METADATA {} {} :{}", target, key, value))]
}
// SVSNICK <uid> <newnick> <nickts> — the new nick takes the current
// time as its TS so it wins any collision resolution.
NetAction::ForceNick { uid, nick } => {
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))]
}
NetAction::Raw(s) => vec![s.clone()],
// Internal: the link layer handles this before serialization.
NetAction::DeferRegister { .. } => vec![],