engine: apply auto-join, vhost and memo notice on SASL connect
All checks were successful
CI / check (push) Successful in 3m44s

A user authenticated via SASL during registration never runs the NickServ
IDENTIFY path, so they silently missed their auto-join channels, vhost, and
waiting-memo notice. The UserConnect handler now applies these login
side-effects when the arriving user is already authenticated, mirroring
identify.rs. Non-SASL connections are unaffected (no account set yet).
This commit is contained in:
Jean Chevronnet 2026-07-16 03:35:32 +00:00
parent dabb18abd4
commit dc23a44f57
No known key found for this signature in database
3 changed files with 76 additions and 0 deletions

View file

@ -387,6 +387,13 @@ impl Db {
self.host_cfg.template.as_deref()
}
/// `account`'s current (non-expired) vhost host string, if it has one.
pub fn active_vhost(&self, account: &str) -> Option<String> {
self.accounts
.get(&key(account))
.and_then(|a| a.vhost.as_ref().filter(|v| v.expires.is_none_or(|e| e > now())).map(|v| v.host.clone()))
}
/// The account whose current (non-expired) vhost is `host`, if any — so a
/// vhost can't be assigned to two accounts and collide on the network.
pub fn vhost_owner(&self, host: &str) -> Option<String> {