]> jfr.im git - irc/quakenet/snircd.git/blobdiff - ircd/m_join.c
Should be unsigned long for A
[irc/quakenet/snircd.git] / ircd / m_join.c
index 74fb5ba749b8ee1d821dc0165ab6a00122a057da..36f5b420022a0ad098d0b7165571e6184aecfd77 100644 (file)
@@ -20,7 +20,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * $Id: m_join.c,v 1.34.2.8 2006/01/07 00:54:09 entrope Exp $
+ * $Id: m_join.c,v 1.34.2.9 2006/02/05 00:50:22 entrope Exp $
  */
 
 #include "config.h"
@@ -150,9 +150,9 @@ int m_join(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
     }
 
     /* BADCHANed channel */
-    if ((gline = gline_find(name, GLINE_BADCHAN | GLINE_EXACT)) &&
-       GlineIsActive(gline) && !IsAnOper(sptr)) {
-      send_reply(sptr, ERR_BANNEDFROMCHAN, name);
+    if (!IsAnOper(sptr) 
+        && (gline = gline_lookup_badchan(name, GLINE_BADCHAN))) {
+      send_reply(sptr, ERR_BADCHANNAME, name, gline->gl_reason);
       continue;
     }
 
@@ -174,6 +174,8 @@ int m_join(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
       }
 
       joinbuf_join(&create, chptr, CHFL_CHANOP | CHFL_CHANNEL_MANAGER);
+      if (feature_bool(FEAT_AUTOCHANMODES) && feature_str(FEAT_AUTOCHANMODES_LIST) && strlen(feature_str(FEAT_AUTOCHANMODES_LIST)) > 0)
+        SetAutoChanModes(chptr);
     } else if (find_member_link(chptr, sptr)) {
       continue; /* already on channel */
     } else if (check_target_limit(sptr, chptr, chptr->chname, 0)) {
@@ -205,6 +207,14 @@ int m_join(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
       else if (*chptr->mode.key && (!key || strcmp(key, chptr->mode.key)))
         err = ERR_BADCHANNELKEY;
 
+      /*
+       * ASUKA_X:
+       * Allow XtraOpers to join all channels.
+       * --Bigfoot
+       */
+      if (IsXtraOp(sptr))
+        err = 0;
+      
       /* An oper with WALK_LCHAN privilege can join a local channel
        * he otherwise could not join by using "OVERRIDE" as the key.
        * This will generate a HACK(4) notice, but fails if the oper
@@ -246,17 +256,13 @@ 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. */
-       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. */
+          (as HACK(2)) when the user ops himself.
+           (There is also no particularly good reason to have the user op 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);