server: scrub a departed user's pending invites via a User.invited reverse index instead of scanning every channel on the network per quit — the old O(channels)-per-quit path was O(channels*quits) on a netsplit; the index is maintained at the 4 invite add/remove sites (INVITE cmd, S2S INVITE, join-consume, UNINVITE)

This commit is contained in:
Jean Chevronnet 2026-08-19 02:09:36 +00:00
parent 5101b1361d
commit ab0ccae71f
7 changed files with 23 additions and 2 deletions

View file

@ -907,6 +907,7 @@ impl Server {
ch.recent_kicks.remove(&uid); // they got back in; clear any +J rejoin timer
if let Some(u) = self.users.get_mut(&uid) {
u.channels.insert(key.clone());
u.invited.remove(&key); // invite consumed — drop it from the reverse index
}
// chancreate: snotice when a brand-new channel comes into being
if is_new