ircv3 STS: advertise sts= (port on plaintext, duration/preload on tls) — the modern tls-upgrade cap

This commit is contained in:
Jean Chevronnet 2026-08-08 21:48:05 +00:00
parent a70ee42aee
commit 6cf9f01ff8
4 changed files with 55 additions and 8 deletions

View file

@ -67,6 +67,9 @@ impl Command for Rehash {
s.dnsbl_action = fresh.dnsbl_action;
s.dnsbl_reason = fresh.dnsbl_reason;
s.sasl_server = fresh.sasl_server;
s.sts_duration = fresh.sts_duration;
s.sts_port = fresh.sts_port;
s.sts_preload = fresh.sts_preload;
s.announce("Server configuration reloaded.");
s.numeric(uid, RPL_REHASHING, &format!("{path} :Rehashing"));
}

View file

@ -124,14 +124,12 @@ impl Command for Cap {
u.cap = true; // hold registration until CAP END
u.cap_302 |= cap302;
}
s.send(
uid,
format!(
":{} CAP {who} LS :{}",
s.name,
Caps::ls_line(cap302, secure)
),
);
let mut caps = Caps::ls_line(cap302, secure);
if let Some(sts) = s.sts_token(secure) {
caps.push(' ');
caps.push_str(&sts); // IRCv3 STS — advertised, not REQ-able
}
s.send(uid, format!(":{} CAP {who} LS :{caps}", s.name));
}
"REQ" => {
if let Some(u) = s.users.get_mut(&uid) {