diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/include/channel.h ircd-hybrid-6.0/include/channel.h
--- ircd-hybrid-6.0.orig/include/channel.h	Sun May 27 20:42:58 2001
+++ ircd-hybrid-6.0/include/channel.h	Sun May 27 20:39:48 2001
@@ -65,6 +65,7 @@
   struct SLink*   banlist;
   struct SLink*   exceptlist;
   struct SLink*   denylist;
+  struct SLink*   invexlist;
   int             num_bed;  /* number of bans+exceptions+denies */
   time_t          channelts;
   int             locally_created;  /* used to flag a locally created channel */
@@ -138,6 +139,7 @@
 #define CHFL_BAN        0x0008 /* ban channel flag */
 #define CHFL_EXCEPTION  0x0010 /* exception to ban channel flag */
 #define CHFL_DENY       0x0020 /* regular expression deny flag */
+#define CHFL_INVEX      0x0040 /* invex channel flag */
 
 /* Channel Visibility macros */
 
@@ -153,9 +155,10 @@
 #define MODE_BAN        0x0400
 #define MODE_EXCEPTION  0x0800
 #define MODE_DENY       0x1000
+#define MODE_INVEX      0x2000
 
-#define MODE_LIMIT      0x2000  /* was 0x1000 */
-#define MODE_FLAGS      0x2fff  /* was 0x1fff */
+#define MODE_LIMIT      0x4000  /* was 0x1000 */
+#define MODE_FLAGS      0x4fff  /* was 0x1fff */
 
 #ifdef NEED_SPLITCODE
 
@@ -181,7 +184,7 @@
  * mode flags which take another parameter (With PARAmeterS)
  */
 #define MODE_WPARAS (MODE_CHANOP|MODE_VOICE|MODE_BAN|\
-                     MODE_EXCEPTION|MODE_DENY|MODE_KEY|MODE_LIMIT)
+                     MODE_EXCEPTION|MODE_DENY|MODE_KEY|MODE_LIMIT|MODE_INVEX)
 
 /*
  * Undefined here, these are used in conjunction with the above modes in
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/include/numeric.h ircd-hybrid-6.0/include/numeric.h
--- ircd-hybrid-6.0.orig/include/numeric.h	Sun May 27 20:42:58 2001
+++ ircd-hybrid-6.0/include/numeric.h	Sun May 27 20:39:48 2001
@@ -245,6 +245,8 @@
 #define RPL_INVITING         341
 #define RPL_SUMMONING        342
 
+#define RPL_INVITELIST       346
+#define RPL_ENDOFINVITELIST  347
 #define RPL_EXCEPTLIST       348
 #define RPL_ENDOFEXCEPTLIST  349
 
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/include/s_serv.h ircd-hybrid-6.0/include/s_serv.h
--- ircd-hybrid-6.0.orig/include/s_serv.h	Sun May 27 20:42:56 2001
+++ ircd-hybrid-6.0/include/s_serv.h	Sun May 27 20:39:48 2001
@@ -45,6 +45,7 @@
 #define CAP_EX          0x00000008      /* Can do channel +e exemptions */
 #define CAP_CHW         0x00000010      /* Can do channel wall @# */
 #define CAP_DE          0x00000020      /* Can do channel +d (regex deny) */
+#define CAP_IE          0x00000040      /* can do +I */
 #define CAP_OPN         0x10000000      /* Can do sethost, setident, setname,
                                            allows opers to hack modes, accepts
                                            glines without vote, has nicklen 30
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/src/channel.c ircd-hybrid-6.0/src/channel.c
--- ircd-hybrid-6.0.orig/src/channel.c	Sun May 27 20:42:58 2001
+++ ircd-hybrid-6.0/src/channel.c	Sun May 27 20:39:48 2001
@@ -70,19 +70,14 @@
 struct Channel *channel = NullChn;
 
 static  void    add_invite (struct Client *, struct Channel *);
-static  int     add_banid (struct Client *, struct Channel *, char *);
-static  int     add_exceptid(struct Client *, struct Channel *, char *);
-static  int     add_denyid(struct Client *, struct Channel *, char *);
 static  int     can_join (struct Client *, struct Channel *, char *,int *);
-static  int     del_banid (struct Channel *, char *);
-static  int     del_exceptid (struct Channel *, char *);
-static  int     del_denyid (struct Channel *, char *);
+static  int     add_id(struct Client *, struct Channel *, char *, int);
+static  int     del_id (struct Channel *, char *, int);
 static  void    clear_bans_exceptions_denies(struct Client *,struct Channel *);
 static  void    free_bans_exceptions_denies(struct Channel *);
 static  int     is_banned (struct Client *, struct Channel *);
 static  void    sub1_from_channel (struct Channel *);
 
-
 /* static functions used in set_mode */
 static char *fix_key(char *);
 static char *fix_key_old(char *);
@@ -163,187 +158,64 @@
 }
 
 /*
- * Ban functions to work with mode +b
+ * Ban functions to work with mode +b/e/d/I
  */
-/* add_banid - add an id to be banned to the channel  (belongs to cptr) */
+/* add the specified ID to the channel..
+     -is 8/9/00 */
+/* backported from ircd-hybrid-7 for +ins 5/11/00 -is */
+/* ported to dancer-hybrid 29/1/01 - is */
 
-static  int     add_banid(struct Client *cptr, struct Channel *chptr, char *banid)
+static  int     add_id(struct Client *cptr, struct Channel *chptr,
+                          char *banid, int type)
 {
-  Link  *ban;
+  struct SLink  *ban;
+  struct SLink  **list;
 
   /* dont let local clients overflow the banlist */
   if ((!IsServer(cptr)) && (chptr->num_bed >= MAXBANS))
-	  if (MyClient(cptr))
-	    {
-	      sendto_one(cptr, form_str(ERR_BANLISTFULL),
+          if (MyClient(cptr))
+            {
+              sendto_one(cptr, form_str(ERR_BANLISTFULL),
                    me.name, cptr->name,
                    chptr->chname, banid);
-	      return -1;
-	    }
-  
-  if (MyClient(cptr))
-    collapse(banid);
-
-  for (ban = chptr->banlist; ban; ban = ban->next)
-	  if (match(BANSTR(ban), banid))
-	    return -1;
-
-  ban = make_link();
-  memset(ban, 0, sizeof(Link));
-  ban->flags = CHFL_BAN;
-  ban->next = chptr->banlist;
-
-#ifdef BAN_INFO
-
-  ban->value.banptr = (aBan *)MyMalloc(sizeof(aBan));
-  ban->value.banptr->banstr = (char *)MyMalloc(strlen(banid)+1);
-  (void)strcpy(ban->value.banptr->banstr, banid);
-
-#ifdef USE_UH
-  if (IsPerson(cptr))
-    {
-      ban->value.banptr->who =
-        (char *)MyMalloc(strlen(cptr->name)+
-                         strlen(cptr->username)+
-                         strlen(cptr->host)+3);
-      ircsprintf(ban->value.banptr->who, "%s!%s@%s",
-                 cptr->name, cptr->username, cptr->host);
-    }
-  else
-    {
-#endif
-      ban->value.banptr->who = (char *)MyMalloc(strlen(cptr->name)+1);
-      (void)strcpy(ban->value.banptr->who, cptr->name);
-#ifdef USE_UH
-    }
-#endif
-
-  ban->value.banptr->when = CurrentTime;
-
-#else
-
-  ban->value.cp = (char *)MyMalloc(strlen(banid)+1);
-  (void)strcpy(ban->value.cp, banid);
-
-#endif  /* #ifdef BAN_INFO */
-
-  chptr->banlist = ban;
-  chptr->num_bed++;
-  return 0;
-}
-
-/* add_exceptid - add an id to the exception list for the channel  
- * (belongs to cptr) 
- */
-
-static  int     add_exceptid(struct Client *cptr, struct Channel *chptr, char *eid)
-{
-  Link  *ex, *ban;
-
-  /* dont let local clients overflow the banlist */
-  if ((!IsServer(cptr)) && (chptr->num_bed >= MAXBANS))
-    if (MyClient(cptr))
-      {
-        sendto_one(cptr, form_str(ERR_BANLISTFULL),
-                   me.name, cptr->name,
-                   chptr->chname, eid);
-        return -1;
-      }
+              return -1;
+            }
 
   if (MyClient(cptr))
-    (void)collapse(eid);
-
-  for (ban = chptr->exceptlist; ban; ban = ban->next)
-	  if (match(BANSTR(ban), eid))
-	    return -1;
-  
-
-  ex = make_link();
-  memset(ex, 0, sizeof(Link));
-  ex->flags = CHFL_EXCEPTION;
-  ex->next = chptr->exceptlist;
-
-#ifdef BAN_INFO
-
-  ex->value.banptr = (aBan *)MyMalloc(sizeof(aBan));
-  ex->value.banptr->banstr = (char *)MyMalloc(strlen(eid)+1);
-  (void)strcpy(ex->value.banptr->banstr, eid);
+    collapse(banid);
 
-#ifdef USE_UH
-  if (IsPerson(cptr))
-    {
-      ex->value.banptr->who =
-        (char *)MyMalloc(strlen(cptr->name)+
-                         strlen(cptr->username)+
-                         strlen(cptr->host)+3);
-      ircsprintf(ex->value.banptr->who, "%s!%s@%s",
-                 cptr->name, cptr->username, cptr->host);
-    }
-  else
+  switch(type)
     {
-#endif
-      ex->value.banptr->who = (char *)MyMalloc(strlen(cptr->name)+1);
-      (void)strcpy(ex->value.banptr->who, cptr->name);
-#ifdef USE_UH
+    case CHFL_BAN:
+      list = &chptr->banlist;
+      break;
+    case CHFL_EXCEPTION:
+      list = &chptr->exceptlist;
+      break;
+    case CHFL_DENY:
+      list = &chptr->denylist;
+      break;
+    case CHFL_INVEX:
+      list = &chptr->invexlist;
+      break;
+    default:
+      sendto_realops("add_id() called with unknown ban type %d!", type);
+      return -1;
     }
-#endif
-
-  ex->value.banptr->when = CurrentTime;
-
-#else
-
-  ex->value.cp = (char *)MyMalloc(strlen(eid)+1);
-  (void)strcpy(ex->value.cp, eid);
-
-#endif  /* #ifdef BAN_INFO */
-
-  chptr->exceptlist = ex;
-  chptr->num_bed++;
-  return 0;
-}
-
 
-/*
- * add_denyid - add an id to be denied to the channel  (belongs to cptr) 
- * works like an Xline, but for channels.
- * -sean
- */  
-static  int     add_denyid(struct Client *cptr, struct Channel *chptr, char *banid)
-{
-  Link  *ban;
-
-  /* truncate to REALLEN */
-  if(strlen(banid) >= (REALLEN-1))
-    banid[REALLEN-1]='\0';
-
-  if ((!IsServer(cptr)) && (chptr->num_bed >= MAXBANS))
-    if (MyClient(cptr))
-      {
-        sendto_one(cptr, form_str(ERR_BANLISTFULL),
-                   me.name, cptr->name,
-                   chptr->chname, banid);
-        return -1;
-      }
-
-  if (MyClient(cptr))
-    (void)collapse(banid);
+  for (ban = *list; ban; ban = ban->next)
+          if (match(BANSTR(ban), banid))
+            return -1;
 
-  for (ban = chptr->denylist; ban; ban = ban->next)
-    if (strcasecmp(BANSTR(ban), banid)==0) 
-      return -1;
-  
   ban = make_link();
-  memset(ban, 0, sizeof(Link));
-  ban->flags = CHFL_DENY;
-  ban->next = chptr->denylist;
-
-#ifdef BAN_INFO
+  memset(ban, 0, sizeof(struct SLink));
+  ban->flags = type;
+  ban->next = *list;
 
   ban->value.banptr = (aBan *)MyMalloc(sizeof(aBan));
   ban->value.banptr->banstr = (char *)MyMalloc(strlen(banid)+1);
   (void)strcpy(ban->value.banptr->banstr, banid);
 
-#ifdef USE_UH
   if (IsPerson(cptr))
     {
       ban->value.banptr->who =
@@ -353,151 +225,82 @@
       ircsprintf(ban->value.banptr->who, "%s!%s@%s",
                  cptr->name, cptr->username, cptr->host);
     }
-   else
+  else
     {
-#endif
       ban->value.banptr->who = (char *)MyMalloc(strlen(cptr->name)+1);
       (void)strcpy(ban->value.banptr->who, cptr->name);
-#ifdef USE_UH
     }
-#endif
 
   ban->value.banptr->when = CurrentTime;
+                                                                        
 
-#else
-
-  ban->value.cp = (char *)MyMalloc(strlen(banid)+1);
-  (void)strcpy(ban->value.cp, banid);
-
-#endif  /* #ifdef BAN_INFO */
-
-  chptr->denylist = ban;
+  *list = ban;
   chptr->num_bed++;
   return 0;
 }
 
-
-
 /*
  *
- * "del_banid - delete an id belonging to cptr
+ * "del_id - delete an id belonging to cptr
  * if banid is null, deleteall banids belonging to cptr."
  *
  * from orabidoo
+ * modified 8/9/00 by is: now we handle all ban types here
+ * (invex/excemp/deny/etc)
  */
-static  int     del_banid(struct Channel *chptr, char *banid)
-{
-  register Link **ban;
-  register Link *tmp;
-
-  if (!banid)
-    return -1;
-  for (ban = &(chptr->banlist); *ban; ban = &((*ban)->next))
-#ifdef BAN_INFO
-    if (irccmp(banid, (*ban)->value.banptr->banstr)==0)
-#else
-      if (irccmp(banid, (*ban)->value.cp)==0)
-#endif
-        {
-          tmp = *ban;
-          *ban = tmp->next;
-#ifdef BAN_INFO
-          MyFree(tmp->value.banptr->banstr);
-          MyFree(tmp->value.banptr->who);
-          MyFree(tmp->value.banptr);
-#else
-          MyFree(tmp->value.cp);
-#endif
-          free_link(tmp);
-	  /* num_bed should never be < 0 */
-	  if(chptr->num_bed > 0)
-	    chptr->num_bed--;
-	  else
-	    chptr->num_bed = 0;
-          break;
-        }
-  return 0;
-}
+/* backported from ircd-hybrid-7 to +ins 5/11/00 -is */
+/* ported to dancer-hybrid 29/01/01 -is */
 
-/*
- * del_exceptid - delete an id belonging to cptr
- *
- * from orabidoo
- */
-static  int     del_exceptid(struct Channel *chptr, char *eid)
+static  int     del_id(struct Channel *chptr, char *banid, int type)
 {
-  register Link **ex;
-  register Link *tmp;
+  register struct SLink *ban;
+  register struct SLink *tmp;
+  register struct SLink **list;
 
-  if (!eid)
+  if (!banid)
     return -1;
-  for (ex = &(chptr->exceptlist); *ex; ex = &((*ex)->next))
-    if (irccmp(eid, BANSTR(*ex)) == 0)
-      {
-        tmp = *ex;
-        *ex = tmp->next;
-#ifdef BAN_INFO
-        MyFree(tmp->value.banptr->banstr);
-        MyFree(tmp->value.banptr->who);
-        MyFree(tmp->value.banptr);
-#else
-        MyFree(tmp->value.cp);
-#endif
-        free_link(tmp);
-	/* num_bed should never be < 0 */
-	if(chptr->num_bed > 0)
-	  chptr->num_bed--;
-	else
-	  chptr->num_bed = 0;
-        break;
-      }
-  return 0;
-}
 
-/*
- *
- * "del_denyid - delete an id belonging to cptr
- * if banid is null, deleteall banids belonging to cptr."
- *
- * -sean
- */
-static  int     del_denyid(struct Channel *chptr, char *banid)
-{
-  register Link **ban;
-  register Link *tmp;
+  switch(type)
+    {
+    case CHFL_BAN:
+      list = &chptr->banlist;
+      break;
+    case CHFL_EXCEPTION:
+      list = &chptr->exceptlist;
+      break;
+    case CHFL_DENY:
+      list = &chptr->denylist;
+      break;
+    case CHFL_INVEX:
+      list = &chptr->invexlist;
+      break;
+    default:
+      sendto_realops("del_id() called with unknown ban type %d!", type);
+      return -1;
+    }
 
-  if (!banid)
-    return -1;
-  for (ban = &(chptr->denylist); *ban; ban = &((*ban)->next))
-#ifdef BAN_INFO
-    if (strcasecmp(banid, (*ban)->value.banptr->banstr)==0) 
-#else
-      if (strcasecmp(banid, (*ban)->value.cp)==0)
-#endif
+  for (ban = *list; ban; ban = ban->next)
+    {
+      if (irccmp(banid, ban->value.banptr->banstr)==0)
         {
-          tmp = *ban;
-          *ban = tmp->next;
-#ifdef BAN_INFO
+          tmp = ban;
+          *list = tmp->next;
           MyFree(tmp->value.banptr->banstr);
           MyFree(tmp->value.banptr->who);
           MyFree(tmp->value.banptr);
-#else
-          MyFree(tmp->value.cp);
-#endif
           free_link(tmp);
-
-	  /* num_bed should never be < 0 */
-	  if(chptr->num_bed > 0)
-	    chptr->num_bed--;
-	  else
-	    chptr->num_bed = 0;
+          /* num_bed should never be < 0 */
+          if(chptr->num_bed > 0)
+            chptr->num_bed--;
+          else
+            chptr->num_bed = 0;
           break;
         }
+    }
   return 0;
 }
 
 
-
 /*
  * del_matching_exception - delete an exception matching this user
  *
@@ -631,6 +434,28 @@
   return ((tmp?CHFL_BAN:0));
 }
 
+static  int is_invex(struct Client *cptr,struct Channel *chptr)
+{
+  register Link *tmp;
+  char  s[NICKLEN+USERLEN+HOSTLEN+6];
+  char  *s2;
+
+  if (!IsPerson(cptr))
+    return (0);
+
+  strcpy(s, make_nick_user_host(cptr->name, cptr->username, cptr->host));
+  s2 = make_nick_user_host(cptr->name, cptr->username,
+                           inetntoa((char*) &cptr->ip));
+
+  for (tmp = chptr->invexlist; tmp; tmp = tmp->next)
+    if (match(BANSTR(tmp), s) ||
+        match(BANSTR(tmp), s2))
+      return(1);
+      
+  return(0) ;
+}
+
+
 /*
  * adds a user to a channel by adding another link to the channels member
  * chain.
@@ -1005,6 +830,18 @@
   if (modebuf[1] || *parabuf)
     sendto_one(cptr, ":%s MODE %s %s %s",
                me.name, chptr->chname, modebuf, parabuf);
+
+  if (IsCapable(cptr, CAP_IE))
+    {
+      *parabuf = '\0';
+      *modebuf = '+';
+      modebuf[1] = '\0';
+      send_mode_list(cptr, chptr->chname, chptr->invexlist, CHFL_INVEX,'I');
+
+      if (modebuf[1] || *parabuf)
+	sendto_one(cptr, ":%s MODE %s %s %s",
+		   me.name, chptr->chname, modebuf, parabuf);
+    }
 }
 
 /* stolen from Undernet's ircd  -orabidoo
@@ -1098,8 +935,11 @@
 #define SM_ERR_RPL_C            0x00000008
 #define SM_ERR_RPL_B            0x00000010
 #define SM_ERR_RPL_E            0x00000020
-#define SM_ERR_NOTONCHANNEL     0x00000040      /* Not on channel */
-#define SM_ERR_RESTRICTED       0x00000080      /* Restricted chanop */
+#define SM_ERR_RPL_I            0x00000040
+#define SM_ERR_NOTONCHANNEL     0x00000080      /* Not on channel */
+#define SM_ERR_RESTRICTED       0x00000100      /* Restricted chanop */
+#define SM_ERR_NOOPS		0x00000200	/* Chanops needed - AGB */
+#define SM_ERR_UNKNOWN		0x00000400	/* Unknown mode - AGB */
 
 /*
 ** Apply the mode changes passed in parv to chptr, sending any error
@@ -1466,6 +1306,92 @@
 
           break;
 
+        case 'I':
+          if (whatt == MODE_QUERY || parc-- <= 0)
+            {
+              if (!MyClient(sptr))
+                break;
+              if (errsent(SM_ERR_RPL_I, &errors_sent))
+                break;
+              /* don't allow a non chanop to see the invex list
+               *                */
+              if(isok)
+                {
+                  for (lp = chptr->invexlist; lp; lp = lp->next)
+                    sendto_one(cptr, form_str(RPL_INVITELIST),
+                               me.name, cptr->name,
+                               chptr->chname,
+                               lp->value.banptr->banstr,
+                               lp->value.banptr->who,
+                               lp->value.banptr->when);
+
+                  sendto_one(sptr, form_str(RPL_ENDOFINVITELIST),
+                             me.name, sptr->name,
+                             chptr->chname);
+                }
+              break;
+            }
+          arg = check_string(*parv++);
+
+#ifndef INVEX
+          if (MyClient(sptr) && !errsent(SM_ERR_UNKNOWN, &errors_sent)) {
+                  sendto_one(sptr, form_str(ERR_UNKNOWNMODE), me.name, sptr->name, c);
+            break;
+          }
+#endif
+
+          if (MyClient(sptr) && opcnt >= MAXMODEPARAMS)
+            break;
+
+          if (!isok)
+            {
+              if (!errsent(SM_ERR_NOOPS, &errors_sent) && MyClient(sptr))
+                sendto_one(sptr, form_str(ERR_CHANOPRIVSNEEDED),
+                           me.name, sptr->name,
+                           chptr->chname);
+              break;
+            }
+
+          if(MyClient(sptr))
+            chptr->keep_their_modes = YES;
+          else if(!chptr->keep_their_modes)
+            {
+              parc--;
+              parv++;
+              break;
+            }
+
+          /* user-friendly ban mask generation, taken
+           *           ** from Undernet's ircd  -orabidoo
+           *                     */
+          if (MyClient(sptr))
+            arg = collapse(pretty_mask(arg));
+
+          if(*arg == ':')
+            {
+              parc--;
+              parv++;
+              break;
+            }
+
+          tmp = strlen(arg);
+          if (len + tmp + 2 >= MODEBUFLEN)
+            break;
+
+          if (!(((whatt & MODE_ADD) && !add_id(sptr, chptr, arg, CHFL_INVEX)) ||
+                ((whatt & MODE_DEL) && !del_id(chptr, arg, CHFL_INVEX))))
+            break;
+
+          *mbufw++ = plus;
+          *mbufw++ = 'I';
+          strcpy(pbufw, arg);
+          pbufw += strlen(pbufw);
+          *pbufw++ = ' ';
+          len += tmp + 1;
+          opcnt++;
+
+	  break;
+
           /* There is a nasty here... I'm supposed to have
            * CAP_EX before I can send exceptions to bans to a server.
            * But that would mean I'd have to keep two strings
@@ -1555,8 +1481,8 @@
           if (len + tmp + 2 >= MODEBUFLEN)
             break;
 
-          if (!(((whatt & MODE_ADD) && !add_exceptid(sptr, chptr, arg)) ||
-                ((whatt & MODE_DEL) && !del_exceptid(chptr, arg))))
+          if (!(((whatt & MODE_ADD) && !add_id(sptr, chptr, arg, CHFL_EXCEPTION)) ||
+                ((whatt & MODE_DEL) && !del_id(chptr, arg, CHFL_EXCEPTION))))
             break;
 
           /* This stuff can go back in when all servers understand +e 
@@ -1646,8 +1572,8 @@
           if (len + tmp + 2 >= MODEBUFLEN)
             break;
 
-          if (!(((whatt & MODE_ADD) && !add_denyid(sptr, chptr, arg)) ||
-                ((whatt & MODE_DEL) && !del_denyid(chptr, arg))))
+          if (!(((whatt & MODE_ADD) && !add_id(sptr, chptr, arg, CHFL_DENY)) ||
+                ((whatt & MODE_DEL) && !del_id(chptr, arg, CHFL_DENY))))
             break;
 
           /* This stuff can go back in when all servers understand +e 
@@ -1767,8 +1693,8 @@
           if (len + tmp + 2 >= MODEBUFLEN)
             break;
 
-          if (!(((whatt & MODE_ADD) && !add_banid(sptr, chptr, arg)) ||
-                ((whatt & MODE_DEL) && !del_banid(chptr, arg))))
+          if (!(((whatt & MODE_ADD) && !add_id(sptr, chptr, arg, CHFL_BAN)) ||
+                ((whatt & MODE_DEL) && !del_id(chptr, arg, CHFL_BAN))))
             break;
 
           *mbufw++ = plus;
@@ -2265,7 +2191,7 @@
   else
     *flags |= ban_or_exception; /* Mark this client as "charmed" */
 
-  if (chptr->mode.mode & MODE_INVITEONLY)
+  if ((chptr->mode.mode & MODE_INVITEONLY) && !is_invex(sptr, chptr))
     {
       for (lp = sptr->user->invited; lp; lp = lp->next)
         if (lp->value.chptr == chptr)
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/src/messages.tab ircd-hybrid-6.0/src/messages.tab
--- ircd-hybrid-6.0.orig/src/messages.tab	Sun May 27 20:42:58 2001
+++ ircd-hybrid-6.0/src/messages.tab	Sun May 27 20:39:48 2001
@@ -377,8 +377,8 @@
 /* 343 */       (char *)NULL,
 /* 344 */       (char *)NULL,
 /* 345 */       (char *)NULL,
-/* 346 */       (char *)NULL,
-/* 347 */       (char *)NULL,
+/* 346 RPL_INVEXLIST */         ":%s 346 %s %s %s %s %lu",
+/* 347 RPL_ENDOFINVEXLIST */    ":%s 347 %s %s :End of Channel Invite List",
 #ifdef BAN_INFO
 /* 348 RPL_EXCEPTLIST */        ":%s 348 %s %s %s %s %lu",
 #else
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/src/messages_cust.tab ircd-hybrid-6.0/src/messages_cust.tab
--- ircd-hybrid-6.0.orig/src/messages_cust.tab	Sun May 27 20:42:58 2001
+++ ircd-hybrid-6.0/src/messages_cust.tab	Sun May 27 20:39:48 2001
@@ -378,8 +378,8 @@
 /* 343 */       (char *)NULL,
 /* 344 */       (char *)NULL,
 /* 345 */       (char *)NULL,
-/* 346 */       (char *)NULL,
-/* 347 */       (char *)NULL,
+/* 346 RPL_INVEXLIST */         ":%s 346 %s %s %s %s %lu",
+/* 347 RPL_ENDOFINVEXLIST */    ":%s 347 %s %s :End of Channel Invite List",
 #ifdef BAN_INFO
 /* 348 RPL_EXCEPTLIST */        ":%s 348 %s %s %s %s %lu",
 #else
diff -ruN -x configure -x *~ -x ircd-hybrid-6.0.orig -x *.rej ircd-hybrid-6.0.orig/src/s_serv.c ircd-hybrid-6.0/src/s_serv.c
--- ircd-hybrid-6.0.orig/src/s_serv.c	Sun May 27 20:42:57 2001
+++ ircd-hybrid-6.0/src/s_serv.c	Sun May 27 20:39:48 2001
@@ -75,6 +75,7 @@
   { "CHW",      CAP_CHW },
   { "DE",       CAP_DE },
   { "OPN",      CAP_OPN },
+  { "IE", 	CAP_IE }, 
   { 0,   0 }
 };
 
