Author: Kev <klmitch@mit.edu>
[ircu2.10.12-pk.git] / ircd / m_who.c
index cb8bf65e2680623580b3417b669d4b52af18a74f..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"
@@ -210,6 +210,10 @@ int m_who(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
         case 'R':
           matchsel |= WHO_FIELD_REN;
           continue;
+        case 'a':
+        case 'A':
+          matchsel |= WHO_FIELD_ACC;
+          continue;
       }
     if (ch == '%')
       while ((ch = *p++) && (ch != ','))
@@ -260,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;
         }
@@ -273,10 +281,8 @@ int m_who(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   if (!fields)
     counter = 7;
 
-#ifdef HEAD_IN_SAND_WHO_SERVERNAME
-  if (!IsAnOper(sptr))
+  if (feature_bool(FEAT_HIS_WHO_SERVERNAME) && !IsAnOper(sptr))
     matchsel &= ~WHO_FIELD_SER;
-#endif
 
   if (qrt && (fields & WHO_FIELD_QTY))
   {
@@ -390,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))
@@ -430,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))