Fix SF#1706004 by reporting the new value after /set and /reset.
[ircu2.10.12-pk.git] / ircd / m_who.c
index 6b277f1bcd41d5c2e06cfd82a5154dc84c88b238..9ee0f074d0bdddc9fa69443e51b231fb09491575 100644 (file)
@@ -271,6 +271,10 @@ int m_who(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
           case 'A':
             fields |= WHO_FIELD_ACC;
             break;
+          case 'o':
+          case 'O':
+            fields |= WHO_FIELD_OPL;
+            break;
           default:
             break;
         }
@@ -376,6 +380,8 @@ int m_who(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
         matchsel &= ~WHO_FIELD_UID;
       if ((minlen > HOSTLEN) || !(cset & NTL_IRCHN))
         matchsel &= ~WHO_FIELD_HOS;
+      if ((minlen > ACCOUNTLEN))
+        matchsel &= ~WHO_FIELD_ACC;
     }
 
     /* First of all loop through the clients in common channels */
@@ -409,7 +415,9 @@ int m_who(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
               || matchexec(cli_info(acptr), mymask, minlen))
               && ((!(matchsel & WHO_FIELD_NIP))
              || (HasHiddenHost(acptr) && !IsAnOper(sptr))
-              || !ipmask_check(&cli_ip(acptr), &imask, ibits)))
+              || !ipmask_check(&cli_ip(acptr), &imask, ibits))
+              && ((!(matchsel & WHO_FIELD_ACC))
+              || matchexec(cli_user(acptr)->account, mymask, minlen)))
             continue;
           if (!SHOW_MORE(sptr, counter))
             break;
@@ -445,7 +453,9 @@ int m_who(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
             || matchexec(cli_info(acptr), mymask, minlen))
             && ((!(matchsel & WHO_FIELD_NIP))
            || (HasHiddenHost(acptr) && !IsAnOper(sptr))
-            || !ipmask_check(&cli_ip(acptr), &imask, ibits)))
+            || !ipmask_check(&cli_ip(acptr), &imask, ibits))
+            && ((!(matchsel & WHO_FIELD_ACC))
+            || matchexec(cli_user(acptr)->account, mymask, minlen)))
           continue;
         if (!SHOW_MORE(sptr, counter))
           break;