Fix bugs relating to joining zannels for a quick release.
[ircu2.10.12-pk.git] / ircd / m_join.c
index 9056c077837cb09dde7a6d3d4e964c3976b35320..b5a675cb20cb7d3093caf3b9c36ed8a65fb7372f 100644 (file)
@@ -245,10 +245,18 @@ int m_join(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
 
       joinbuf_join(&join, chptr, flags);
       if (flags & CHFL_CHANOP) {
+        struct ModeBuf mbuf;
+#if 0
         /* Send a MODE to the other servers. If the user used the A/U pass,
         * let his server op him, otherwise let him op himself. */
-        struct ModeBuf mbuf;
        modebuf_init(&mbuf, chptr->mode.apass[0] ? &me : sptr, cptr, chptr, MODEBUF_DEST_SERVER);
+#else
+       /* Always let the server op him: this is needed on a net with older servers
+          because they 'destruct' channels immediately when they become empty without
+          sending out a DESTRUCT message. As a result, they would always bounce a mode
+          (as HACK(2)) when the user ops himself. */
+       modebuf_init(&mbuf, &me, cptr, chptr, MODEBUF_DEST_SERVER);
+#endif
        modebuf_mode_client(&mbuf, MODE_ADD | MODE_CHANOP, sptr,
                             chptr->mode.apass[0] ? ((flags & CHFL_CHANNEL_MANAGER) ? 0 : 1) : MAXOPLEVEL);
        modebuf_flush(&mbuf);