Add new feature FEAT_HIS_WHOIS_LOCALCHAN.
[ircu2.10.12-pk.git] / ircd / m_whois.c
index 5660ba66e344445fd786dd921d9d99111f816691..343ca82d7af9414ed91bcaa8574367e693e4b2bb 100644 (file)
@@ -155,11 +155,18 @@ static void do_whois(struct Client* sptr, struct Client *acptr, int parc)
        if (!ShowChannel(sptr, chptr)
            && !(IsOper(sptr) && IsLocalChannel(chptr->chname)))
           continue;
-          
+
        if (acptr != sptr && IsZombie(chan))
           continue;
-          
-       if (len+strlen(chptr->chname) + mlen > BUFSIZE - 5) 
+
+       /* Don't show local channels when HIS is defined, unless it's a
+       * remote WHOIS --ULtimaTe_
+       */
+       if (IsLocalChannel(chptr->chname) && (acptr != sptr) && (parc == 2)
+           && feature_bool(FEAT_HIS_WHOIS_LOCALCHAN) && !IsAnOper(sptr))
+         continue;
+
+       if (len+strlen(chptr->chname) + mlen > BUFSIZE - 5)
        {
           send_reply(sptr, SND_EXPLICIT | RPL_WHOISCHANNELS, "%s :%s", name, buf);
           *buf = '\0';