Author: Michael Poole <mdpoole@troilus.org>
[ircu2.10.12-pk.git] / ircd / m_whois.c
index 43d7833998c3216c56c9683d41e280bc65118652..f38d6adfefde91a4796d8c6ca3b72923e385d038 100644 (file)
@@ -137,7 +137,8 @@ static void do_whois(struct Client* sptr, struct Client *acptr, int parc)
   
   const struct User* user = cli_user(acptr);
   const char* name = (!*(cli_name(acptr))) ? "?" : cli_name(acptr);  
-  a2cptr = user->server;
+  a2cptr = feature_bool(FEAT_HIS_WHOIS_SERVERNAME) && !IsAnOper(sptr)
+      && sptr != acptr ? &his : user->server;
   assert(user);
   send_reply(sptr, RPL_WHOISUSER, name, user->username, user->host,
                   cli_info(acptr));
@@ -175,7 +176,7 @@ static void do_whois(struct Client* sptr, struct Client *acptr, int parc)
        }
        if (IsDeaf(acptr))
          *(buf + len++) = '-';
-       if (IsOper(sptr) && !ShowChannel(sptr, chptr))
+       if (!ShowChannel(sptr, chptr))
          *(buf + len++) = '*';
        if (IsDelayedJoin(chan) && (sptr != acptr))
          *(buf + len++) = '<';
@@ -196,13 +197,8 @@ static void do_whois(struct Client* sptr, struct Client *acptr, int parc)
         send_reply(sptr, RPL_WHOISCHANNELS, name, buf);
   }
 
-  if (feature_bool(FEAT_HIS_WHOIS_SERVERNAME) && !IsAnOper(sptr) &&
-      sptr != acptr)
-    send_reply(sptr, RPL_WHOISSERVER, name, feature_str(FEAT_HIS_SERVERNAME),
-               feature_str(FEAT_HIS_SERVERINFO));
-  else
-    send_reply(sptr, RPL_WHOISSERVER, name, cli_name(a2cptr),
-              cli_info(a2cptr));
+  send_reply(sptr, RPL_WHOISSERVER, name, cli_name(a2cptr),
+             cli_info(a2cptr));
 
   if (user)
   {