Author: Stephane Thiell <mbuna@undernet.org>
[ircu2.10.12-pk.git] / ircd / m_whois.c
index 45ac83bf6367142c9cc12b6b1f08a1cb8c8d85c6..506fbc42c1a4919373d21e06f5b4ab785ad3df7f 100644 (file)
@@ -185,8 +185,8 @@ static void do_whois(struct Client* sptr, struct Client *acptr, int parc)
 
 #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),
@@ -200,6 +200,13 @@ static void do_whois(struct Client* sptr, struct Client *acptr, int parc)
     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 :)
@@ -434,14 +441,6 @@ int ms_whois(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
 
   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;