*/
#include "config.h"
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
#include "channel.h"
#include "client.h"
#include "hash.h"
/*
* Send whois information for acptr to sptr
*/
-static void do_whois(struct Client* sptr, struct Client *acptr)
+static void do_whois(struct Client* sptr, struct Client *acptr, int parc)
{
struct Client *a2cptr=0;
struct Channel *chptr=0;
#ifdef HEAD_IN_SAND_WHOIS_SERVERNAME
if (!IsAnOper(sptr) && sptr != acptr)
- send_reply(sptr, RPL_WHOISSERVER, name, "*.undernet.org",
- "The Undernet Underworld");
+ send_reply(sptr, RPL_WHOISSERVER, name, HEAD_IN_SAND_SERVERNAME,
+ HEAD_IN_SAND_SERVERINFO);
else
#endif
send_reply(sptr, RPL_WHOISSERVER, name, cli_name(a2cptr),
if (IsAnOper(acptr) && (HasPriv(acptr, PRIV_DISPLAY) ||
HasPriv(sptr, PRIV_SEE_OPERS)))
send_reply(sptr, RPL_WHOISOPERATOR, name);
+
+ if (IsAccount(acptr))
+ send_reply(sptr, RPL_WHOISACCOUNT, name, user->account);
+
+ if (HasHiddenHost(acptr) && IsAnOper(sptr))
+ send_reply(sptr, RPL_WHOISACTUALLY, name, user->username,
+ user->realhost, ircd_ntoa((const char*) &(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))
+ if (MyConnect(acptr)
+#ifdef HEAD_IN_SAND_WHOIS_IDLETIME
+ && (sptr == acptr || IsAnOper(sptr) || parc >= 3)
+#endif
+ )
send_reply(sptr, RPL_WHOISIDLE, name, CurrentTime - user->last,
cli_firsttime(acptr));
}
* returns the number of people found (or, obviously, 0, if none where
* found).
*/
-static int do_wilds(struct Client* sptr,char *nick,int count)
+static int do_wilds(struct Client* sptr, char *nick, int count, int parc)
{
struct Client *acptr; /* Current client we're concidering */
struct User *user; /* the user portion of the client */
/* Should we show this person now? */
if (showperson) {
found++;
- do_whois(sptr,acptr);
+ do_whois(sptr, acptr, parc);
if (count+found>MAX_WHOIS_LINES)
return found;
continue;
if (!showperson)
continue;
- do_whois(sptr,acptr);
+ do_whois(sptr, acptr, parc);
found++;
if (count+found>MAX_WHOIS_LINES)
return found;
/* No wildcards */
acptr = FindUser(nick);
if (acptr && !IsServer(acptr)) {
- do_whois(sptr,acptr);
+ do_whois(sptr, acptr, parc);
found = 1;
}
}
else /* wilds */
- found=do_wilds(sptr,nick,total);
+ found=do_wilds(sptr, nick, total, parc);
if (!found)
send_reply(sptr, ERR_NOSUCHNICK, nick);
if (parc > 2)
{
- struct Client *acptr;
- /* For convenience: Accept a nickname as first parameter, by replacing
- * it with the correct servername - as is needed by hunt_server().
- * This is the secret behind the /whois nick nick trick.
- */
- acptr = FindUser(parv[1]);
- if (acptr)
- parv[1] = cli_name(cli_user(acptr)->server);
if (hunt_server_cmd(sptr, CMD_WHOIS, cptr, 0, "%C :%s", 1, parc, parv) !=
HUNTED_ISME)
return 0;
acptr = FindUser(nick);
if (acptr && !IsServer(acptr)) {
found++;
- do_whois(sptr,acptr);
+ do_whois(sptr, acptr, parc);
}
if (!found)