Author: Kev <klmitch@mit.edu>
[ircu2.10.12-pk.git] / ircd / m_who.c
index 271946b748279209f256abed6d9e1d6188cabf26..a9e68e2c3cd43a24a81f28314d23343d11b4d63a 100644 (file)
@@ -86,8 +86,8 @@
 #include "hash.h"
 #include "ircd.h"
 #include "ircd_chattr.h"
+#include "ircd_features.h"
 #include "ircd_log.h"
-#include "ircd_policy.h"
 #include "ircd_reply.h"
 #include "ircd_string.h"
 #include "match.h"
@@ -204,15 +204,16 @@ int m_who(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
           continue;
         case 's':
         case 'S':
-#ifdef HEAD_IN_SAND_WHO_SERVERNAME
-          if (IsAnOper(sptr))
-#endif
-            matchsel |= WHO_FIELD_SER;
+          matchsel |= WHO_FIELD_SER;
           continue;
         case 'r':
         case 'R':
           matchsel |= WHO_FIELD_REN;
           continue;
+        case 'a':
+        case 'A':
+          matchsel |= WHO_FIELD_ACC;
+          continue;
       }
     if (ch == '%')
       while ((ch = *p++) && (ch != ','))
@@ -253,10 +254,7 @@ int m_who(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
             break;
           case 's':
           case 'S':
-#ifdef HEAD_IN_SAND_WHO_SERVERNAME
-            if (IsAnOper(sptr))
-#endif
-              fields |= WHO_FIELD_SER;
+            fields |= WHO_FIELD_SER;
             break;
           case 't':
           case 'T':
@@ -266,6 +264,10 @@ int m_who(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
           case 'U':
             fields |= WHO_FIELD_UID;
             break;
+          case 'a':
+          case 'A':
+            fields |= WHO_FIELD_ACC;
+            break;
           default:
             break;
         }
@@ -279,6 +281,9 @@ int m_who(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   if (!fields)
     counter = 7;
 
+  if (feature_bool(FEAT_HIS_WHO_SERVERNAME) && !IsAnOper(sptr))
+    matchsel &= ~WHO_FIELD_SER;
+
   if (qrt && (fields & WHO_FIELD_QTY))
   {
     p = qrt;
@@ -391,7 +396,7 @@ int m_who(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
               && ((!(matchsel & WHO_FIELD_UID))
               || matchexec(cli_user(acptr)->username, mymask, minlen))
               && ((!(matchsel & WHO_FIELD_SER))
-              || (!(cli_flags(cli_user(acptr)->server) & FLAGS_MAP)))
+              || (!(HasFlag(cli_user(acptr)->server, FLAG_MAP))))
               && ((!(matchsel & WHO_FIELD_HOS))
               || matchexec(cli_user(acptr)->host, mymask, minlen))
               && ((!(matchsel & WHO_FIELD_HOS))
@@ -431,7 +436,7 @@ int m_who(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
             && ((!(matchsel & WHO_FIELD_UID))
             || matchexec(cli_user(acptr)->username, mymask, minlen))
             && ((!(matchsel & WHO_FIELD_SER))
-            || (!(cli_flags(cli_user(acptr)->server) & FLAGS_MAP)))
+                || (!(HasFlag(cli_user(acptr)->server, FLAG_MAP))))
             && ((!(matchsel & WHO_FIELD_HOS))
             || matchexec(cli_user(acptr)->host, mymask, minlen))
             && ((!(matchsel & WHO_FIELD_HOS))