Author: Kev <klmitch@mit.edu>
[ircu2.10.12-pk.git] / ircd / m_whois.c
index 5a46bdf33c93623b7c58316efb7d799638ff1927..cbbe561d94952c1ed3eb3038b1beb71d0d3354d1 100644 (file)
@@ -79,6 +79,8 @@
  *            note:   it is guaranteed that parv[0]..parv[parc-1] are all
  *                    non-NULL pointers.
  */
+#include "config.h"
+
 #if 0
 /*
  * No need to include handlers.h here the signatures must match
@@ -91,6 +93,7 @@
 #include "client.h"
 #include "hash.h"
 #include "ircd.h"
+#include "ircd_policy.h"
 #include "ircd_reply.h"
 #include "ircd_string.h"
 #include "match.h"
@@ -187,14 +190,23 @@ static void do_whois(struct Client* sptr, struct Client *acptr)
      if (buf[0] != '\0')
         send_reply(sptr, RPL_WHOISCHANNELS, name, buf);
   }
-  send_reply(sptr, RPL_WHOISSERVER, name, cli_name(a2cptr), cli_info(a2cptr));
+
+#ifdef HEAD_IN_SAND_WHOIS_SERVERNAME
+  if (!IsAnOper(sptr) || sptr != a2cptr)
+    send_reply(sptr, RPL_WHOISSERVER, name, "*.undernet.org",
+              "The Undernet Underworld");
+  else
+#endif
+    send_reply(sptr, RPL_WHOISSERVER, name, cli_name(a2cptr),
+              cli_info(a2cptr));
 
   if (user)
   {
     if (user->away)
        send_reply(sptr, RPL_AWAY, name, user->away);
 
-    if (HasPriv(acptr, PRIV_DISPLAY) || HasPriv(sptr, PRIV_SEE_OPERS))
+    if (IsAnOper(acptr) && (HasPriv(acptr, PRIV_DISPLAY) ||
+                           HasPriv(sptr, PRIV_SEE_OPERS)))
        send_reply(sptr, RPL_WHOISOPERATOR, name);
    
     /* Hint: if your looking to add more flags to a user, eg +h, here's