Avoid unwanted races for mode handling during burst processing.
[ircu2.10.12-pk.git] / ircd / m_mode.c
index c994569e878c5d7897c0dbb16bfc3f1ddf3fa71c..ca366ccd65bf243b430c84e6174f1016fac6af48 100644 (file)
@@ -86,6 +86,7 @@
 #include "client.h"
 #include "hash.h"
 #include "ircd.h"
+#include "ircd_features.h"
 #include "ircd_log.h"
 #include "ircd_reply.h"
 #include "ircd_string.h"
@@ -177,10 +178,15 @@ ms_mode(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
                   (MODEBUF_DEST_CHANNEL | /* Send mode to clients */
                    MODEBUF_DEST_SERVER  | /* Send mode to servers */
                    MODEBUF_DEST_HACK4));  /* Send a HACK(4) message */
+    else if (!feature_bool(FEAT_OPLEVELS))
+      modebuf_init(&mbuf, sptr, cptr, chptr,
+                  (MODEBUF_DEST_CHANNEL | /* Send mode to clients */
+                   MODEBUF_DEST_SERVER  | /* Send mode to servers */
+                   MODEBUF_DEST_HACK3));  /* Send a HACK(3) message */
     else
       /* Servers need to be able to op people who join using the Apass
-       * or upass, as well as people joining a zannel, therefore we no
-       * longer generate HACK3. */
+       * or upass, as well as people joining a zannel, therefore we do
+       * not generate HACK3 when oplevels are on. */
       modebuf_init(&mbuf, sptr, cptr, chptr,
                   (MODEBUF_DEST_CHANNEL | /* Send mode to clients */
                    MODEBUF_DEST_SERVER));   /* Send mode to servers */