channel: count remote members for +l, and propagate TBAN expiry (-b) over S2S

This commit is contained in:
Jean Chevronnet 2026-08-17 14:52:38 +00:00
parent 713406870b
commit c1b7ed6dda

View file

@ -601,6 +601,10 @@ impl Server {
ch.bans.retain(|b| b.mask != mask); ch.bans.retain(|b| b.mask != mask);
} }
self.to_channel(&key, &format!(":{} MODE {name} -b {mask}", self.name), None); self.to_channel(&key, &format!(":{} MODE {name} -b {mask}", self.name), None);
// Propagate the removal to linked servers, else they keep the ban
// forever (they stored the original +b without its expiry).
let sid = self.sid.clone();
self.propagate_chan_mode(&sid, &name, "-b", &[mask]);
} }
} }
@ -808,9 +812,14 @@ impl Server {
} }
} }
} }
// +l full — with +L redirect, bounce the user to the target instead (opers override) // +l full — with +L redirect, bounce the user to the target instead (opers override).
// Count every member, local AND remote (services/other-server users), so the
// limit reflects the channel's real network-wide size like InspIRCd.
if let Some(ch) = self.channels.get(&key) { if let Some(ch) = self.channels.get(&key) {
let full = ch.modes.limit.is_some_and(|l| ch.members.len() as u32 >= l); let full = ch
.modes
.limit
.is_some_and(|l| (ch.members.len() + ch.rmembers.len()) as u32 >= l);
let redirect = ch.modes.redirect.clone(); let redirect = ch.modes.redirect.clone();
if full && is_oper { if full && is_oper {
overrode = true; overrode = true;