diff --git a/ircd/m_whois.c b/ircd/m_whois.c index a05feb1..bb9045f 100644 --- a/ircd/m_whois.c +++ b/ircd/m_whois.c @@ -181,8 +181,17 @@ static void do_whois(struct Client* sptr, struct Client *acptr, int parc) send_reply(sptr, RPL_WHOISUSER, name, user->username, user->host, cli_info(acptr)); - /* Display the channels this user is on. */ - if ((!IsChannelService(acptr) && !IsNoChan(acptr)) || (acptr==sptr) || IsAnOper(sptr)) + /* Display the channels this user is on. + * Ascunde canalele dacă: + * - Target e channel service SAU + * - Target are NoChan (+n) SAU + * - Target are PRIV_HIDE_CHANNELS (hide_channels = yes în config) + * EXCEPȚIE: Arată dacă target e tu însuți SAU cine face WHOIS e oper + */ + int hide_target_channels = (IsChannelService(acptr) || IsNoChan(acptr) || + HasPriv(acptr, PRIV_HIDE_CHANNELS)); + + if (!hide_target_channels || (acptr==sptr) || IsAnOper(sptr)) { struct Membership* chan; mlen = strlen(cli_name(&me)) + strlen(cli_name(sptr)) + 12 + strlen(name);