delayjoin +D: hide JOINs until a member speaks/reveals (NAMES + part/quit/nick aware)

This commit is contained in:
Jean Chevronnet 2026-08-09 07:40:10 +00:00
parent 80cc61e7f8
commit 97a35338fa
6 changed files with 134 additions and 7 deletions

View file

@ -434,7 +434,18 @@ impl Command for Part {
} else {
format!(":{prefix} PART {target} :{reason}")
};
s.to_channel_vis(&key, &line, uid); // +u: only ops + self see the part
// +D delayjoin: a still-hidden member's PART is shown only to themselves
let hidden = s
.channels
.get(&key)
.and_then(|c| c.members.get(&uid))
.map(|m| m.hidden)
.unwrap_or(false);
if hidden {
s.send(uid, line.clone());
} else {
s.to_channel_vis(&key, &line, uid); // +u: only ops + self see the part
}
s.propagate_part(uid, target, &reason); // tell linked servers
if let Some(ch) = s.channels.get_mut(&key) {
ch.members.remove(&uid);

View file

@ -400,6 +400,8 @@ pub(crate) fn deliver(s: &mut Server, uid: Uid, params: &[String], notice: bool)
}
}
}
// +D delayjoin: speaking reveals a hidden member (their JOIN goes out first)
s.reveal_member(uid, &key);
// deliver to every member except the sender and +D (deaf) users, tagging
// per-recipient (server-time + any client-only tags on the line)
let line = format!(":{prefix} {cmd} {target} :{body}");