Author: Isomer <isomer@coders.net>
[ircu2.10.12-pk.git] / ircd / channel.c
index cbc46abfaf78e04774ff882fb9c4a423ffdc9568..76a20e8e1d0cdffec7a931a2182714cd969b47d6 100644 (file)
@@ -227,7 +227,7 @@ int sub1_from_channel(struct Channel* chptr)
     int i;
     for (i = 0; i <= HighestFd; i++)
     {
-      struct Client *acptr;
+      struct Client *acptr = 0;
       if ((acptr = LocalClientArray[i]) && acptr->listing &&
           acptr->listing->chptr == chptr)
       {
@@ -3564,13 +3564,8 @@ mode_parse_client(struct ParseState *state, int *flag_p)
   if (MyUser(state->sptr) && state->max_args <= 0) /* drop if too many args */
     return;
 
-  if (state->parc <= 0) { /* warn if not enough args */
-    if (MyUser(state->sptr))
-      need_more_params(state->sptr, state->dir == MODE_ADD ?
-                      (flag_p[0] == MODE_CHANOP ? "MODE +o" : "MODE +v") :
-                      (flag_p[0] == MODE_CHANOP ? "MODE -o" : "MODE -v"));
+  if (state->parc <= 0) /* return if not enough args */
     return;
-  }
 
   t_str = state->parv[state->args_used++]; /* grab arg */
   state->parc--;
@@ -3944,7 +3939,8 @@ joinbuf_join(struct JoinBuf *jbuf, struct Channel *chan, unsigned int flags)
        * exactly the same logic, albeit somewhat more concise, as was in
        * the original m_part.c */
 
-      if (jbuf->jb_type == JOINBUF_TYPE_PARTALL) /* got to remove user here */
+      if (jbuf->jb_type == JOINBUF_TYPE_PARTALL ||
+         IsLocalChannel(chan->chname)) /* got to remove user here */
        remove_user_from_channel(jbuf->jb_source, chan);
     } else {
       /* Add user to channel */