opers: gate NAMES secret-channel visibility on channels/auspex too

Completes the auspex coverage — NAMES now matches WHO/WHOIS/LIST (secret/
private channel members shown to channels/auspex holders, not any oper).
This commit is contained in:
Jean Chevronnet 2026-08-29 02:43:35 +00:00
parent 55863e9cfe
commit 4e72ef790c
No known key found for this signature in database
GPG key ID: 439666D63A9477E4

View file

@ -1250,11 +1250,11 @@ impl Server {
self.numeric(uid, RPL_ENDOFNAMES, &format!("{key} :End of /NAMES list")); self.numeric(uid, RPL_ENDOFNAMES, &format!("{key} :End of /NAMES list"));
return; return;
}; };
// +s (secret) / +p (private): members are hidden from non-members. Reply as // +s (secret) / +p (private): members are hidden from non-members. Reply as if
// if the channel were empty (opers still see it). // the channel were empty (channels/auspex still sees it, like WHO/WHOIS/LIST).
if (ch.modes.secret || ch.modes.private) if (ch.modes.secret || ch.modes.private)
&& !ch.members.contains_key(&uid) && !ch.members.contains_key(&uid)
&& !self.is_oper(uid) && !crate::modules::opertypes::has_priv(self, uid, crate::modules::opertypes::privs::CHANNELS_AUSPEX)
{ {
self.numeric( self.numeric(
uid, uid,