{
chptr = chan->channel;
- if (!ShowChannel(sptr, chptr))
+ 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';
}
if (IsDeaf(acptr))
*(buf + len++) = '-';
- if (is_chan_op(acptr, chptr))
+ if (IsOper(sptr) && !ShowChannel(sptr, chptr))
+ *(buf + len++) = '*';
+ if (IsDelayedJoin(chan) && (sptr != acptr))
+ *(buf + len++) = '<';
+ else if (IsChanOp(chan))
*(buf + len++) = '@';
- else if (has_voice(acptr, chptr))
+ else if (HasVoice(chan))
*(buf + len++) = '+';
else if (IsZombie(chan))
*(buf + len++) = '!';
if (user->away)
send_reply(sptr, RPL_AWAY, name, user->away);
- if (IsAnOper(acptr) && (HasPriv(acptr, PRIV_DISPLAY) ||
- HasPriv(sptr, PRIV_SEE_OPERS)))
+ if (SeeOper(sptr,acptr))
send_reply(sptr, RPL_WHOISOPERATOR, name);
if (IsAccount(acptr))
if (HasHiddenHost(acptr) && (IsAnOper(sptr) || acptr == sptr))
send_reply(sptr, RPL_WHOISACTUALLY, name, user->username,
- user->realhost, ircd_ntoa((const char*) &(cli_ip(acptr))));
-
+ user->realhost, ircd_ntoa(&cli_ip(acptr)));
+
/* Hint: if your looking to add more flags to a user, eg +h, here's
* probably a good place to add them :)
*/
-
+
if (MyConnect(acptr) && (!feature_bool(FEAT_HIS_WHOIS_IDLETIME) ||
(sptr == acptr || IsAnOper(sptr) || parc >= 3)))
- send_reply(sptr, RPL_WHOISIDLE, name, CurrentTime - user->last,
+ send_reply(sptr, RPL_WHOISIDLE, name, CurrentTime - user->last,
cli_firsttime(acptr));
}
}
{
struct Client *acptr; /* Current client we're concidering */
struct User *user; /* the user portion of the client */
- char *name; /* the name of this client */
+ const char *name; /* the name of this client */
struct Membership* chan;
int invis; /* does +i apply? */
int member; /* Is this user on any channels? */
char* p = 0;
int found = 0;
int total = 0;
+ int wildscount = 0;
if (parc < 2)
{
}
}
else /* wilds */
- found=do_wilds(sptr, nick, total, parc);
+ {
+ if (++wildscount > 3) {
+ send_reply(sptr, ERR_QUERYTOOLONG, parv[1]);
+ break;
+ }
+ found=do_wilds(sptr, nick, total, parc);
+ }
if (!found)
send_reply(sptr, ERR_NOSUCHNICK, nick);