Author: Carlo Wood <run@alinoe.com> (Via Isomer <isomer@undernet.org>)
[ircu2.10.12-pk.git] / ircd / m_join.c
index 9381d2dc898e63d41968beb1d3c209c335dffc55..e8f9bebe7172bdc1aecaa038752e28b0a2969f9e 100644 (file)
@@ -248,14 +248,15 @@ int m_join(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
          send_reply(sptr, i, chptr->chname);
          continue;
        }
-      } /* else if ((i = can_join(sptr, chptr, keys))) */
+      } /* else if ((i = can_join(sptr, chptr, keys))) */
 
       joinbuf_join(&join, chptr, flags);
     } else if (!(chptr = get_channel(sptr, name, CGT_CREATE)))
       continue; /* couldn't get channel */
     else if (check_target_limit(sptr, chptr, chptr->chname, 1)) {
       /* Note: check_target_limit will only ever return 0 here */
-      sub1_from_channel(chptr); /* created it... */
+      chptr->members = 0;
+      destruct_channel(chptr); /* created it... */
       continue;
     } else
       joinbuf_join(&create, chptr, flags);