]> jfr.im git - irc/quakenet/snircd.git/blobdiff - ircd/m_whois.c
add sbounce from asuka into snircd tree
[irc/quakenet/snircd.git] / ircd / m_whois.c
index 5d974877316909d74d3df9f073273ec515ee91c7..5db095a8262ef30e47708bc8e313a9cbb8981b8e 100644 (file)
@@ -144,7 +144,7 @@ static void do_whois(struct Client* sptr, struct Client *acptr, int parc)
                   cli_info(acptr));
 
   /* Display the channels this user is on. */
-  if (!IsChannelService(acptr))
+  if ((!IsChannelService(acptr) && !IsNoChan(acptr)) || (acptr==sptr))
   {
     struct Membership* chan;
     mlen = strlen(cli_name(&me)) + strlen(cli_name(sptr)) + 12 + strlen(name);
@@ -211,16 +211,21 @@ static void do_whois(struct Client* sptr, struct Client *acptr, int parc)
     if (IsAccount(acptr))
       send_reply(sptr, RPL_WHOISACCOUNT, name, user->account);
 
-    if (HasHiddenHost(acptr) && (IsAnOper(sptr) || acptr == sptr))
-      send_reply(sptr, RPL_WHOISACTUALLY, name, user->username,
+    if ((HasHiddenHost(acptr) || HasSetHost(acptr)) && (IsAnOper(sptr) || acptr == sptr))
+      send_reply(sptr, RPL_WHOISACTUALLY, name, user->realusername,
                  user->realhost, ircd_ntoa(&cli_ip(acptr)));
 
+    if (!IsAnOper(sptr) && IsParanoid(acptr) && IsAnOper(acptr))
+      sendcmdto_one(&me, CMD_NOTICE, acptr, "%C :whois: %s performed a /WHOIS on you.", acptr, cli_name(sptr));
+    
     /* 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)))
+    if (MyConnect(acptr) &&
+        (IsAnOper(sptr) ||
+         (!IsNoIdle(acptr) && (!feature_bool(FEAT_HIS_WHOIS_IDLETIME) ||
+                              sptr == acptr || parc >= 3))))
        send_reply(sptr, RPL_WHOISIDLE, name, CurrentTime - user->last,
                   cli_firsttime(acptr));
   }