Author: Kev <klmitch@mit.edu>
authorKevin L. Mitchell <klmitch@mit.edu>
Thu, 4 May 2000 18:54:31 +0000 (18:54 +0000)
committerKevin L. Mitchell <klmitch@mit.edu>
Thu, 4 May 2000 18:54:31 +0000 (18:54 +0000)
Log message:

Small fixes for some minor bugs

git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@238 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
ircd/channel.c

index 9ef36ed390abf76193dd73b689bdb34acc095ecb..06aba81da0c3eba812c0e784e4b821b840570462 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2000-05-04  Kevin L. Mitchell  <klmitch@mit.edu>
 
+       * ircd/channel.c: replace bogus assertions with returns, which is
+       logically correct; only wipe out limit/key if they were originally
+       set in the first place; remove user from channel when doing a
+       PARTALL; only send MODE +o for user CREATEing channel if user is
+       not MyUser--CREATE will only be used if the channel did not
+       originally exist, therefore we can assume no one local is on the
+       channel anyway, and we don't exactly need for the user to see an
+       explicit +o for themselves
+
        * doc/readme.gline: describe the syntax of the GLINE command
 
        * doc/readme.jupe: update to reflect a couple of changes to JUPE
 #
 # ChangeLog for ircu2.10.11
 #
-# $Id: ChangeLog,v 1.135 2000-05-04 18:21:48 kev Exp $
+# $Id: ChangeLog,v 1.136 2000-05-04 18:54:31 kev Exp $
 #
 # Insert new changes at beginning of the change list.
 #
index 45b0189a930e39cc642a77fbbe1e3b92d55bf826..cbc46abfaf78e04774ff882fb9c4a423ffdc9568 100644 (file)
@@ -3238,7 +3238,8 @@ mode_parse_limit(struct ParseState *state, int *flag_p)
     return;
   state->done |= DONE_LIMIT;
 
-  assert(0 != state->mbuf);
+  if (!state->mbuf)
+    return;
 
   modebuf_mode_uint(state->mbuf, state->dir | flag_p[0], t_limit);
 
@@ -3301,6 +3302,9 @@ mode_parse_key(struct ParseState *state, int *flag_p)
     return;
   }
 
+  if (!state->mbuf)
+    return;
+
   /* can't add a key if one is set, nor can one remove the wrong key */
   if (!(state->flags & MODE_PARSE_FORCE))
     if ((state->dir == MODE_ADD && *state->chptr->mode.key) ||
@@ -3314,8 +3318,6 @@ mode_parse_key(struct ParseState *state, int *flag_p)
       !ircd_strcmp(state->chptr->mode.key, t_str))
     return; /* no key change */
 
-  assert(0 != state->mbuf);
-
   if (state->flags & MODE_PARSE_BOUNCE) {
     if (*state->chptr->mode.key) /* reset old key */
       modebuf_mode_string(state->mbuf, MODE_DEL | flag_p[0],
@@ -3690,7 +3692,8 @@ mode_parse_mode(struct ParseState *state, int *flag_p)
     return;
   }
 
-  assert(0 != state->mbuf);
+  if (!state->mbuf)
+    return;
 
   modebuf_mode(state->mbuf, state->dir | flag_p[0]);
 
@@ -3864,10 +3867,10 @@ mode_parse(struct ModeBuf *mbuf, struct Client *cptr, struct Client *sptr,
     return state.args_used; /* tell our parent how many args we gobbled */
 
   if (state.flags & MODE_PARSE_WIPEOUT) {
-    if (!(state.done & DONE_LIMIT)) /* remove the old limit */
+    if (state.chptr->mode.limit && !(state.done & DONE_LIMIT))
       modebuf_mode_uint(state.mbuf, MODE_DEL | MODE_LIMIT,
                        state.chptr->mode.limit);
-    if (!(state.done & DONE_KEY)) /* remove the old key */
+    if (*state.chptr->mode.key && !(state.done & DONE_KEY))
       modebuf_mode_string(state.mbuf, MODE_DEL | MODE_KEY,
                          state.chptr->mode.key, 0);
   }
@@ -3940,6 +3943,9 @@ joinbuf_join(struct JoinBuf *jbuf, struct Channel *chan, unsigned int flags)
        * when we gang all the channel parts together.  Note that this is
        * 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 */
+       remove_user_from_channel(jbuf->jb_source, chan);
     } else {
       /* Add user to channel */
       add_user_to_channel(chan, jbuf->jb_source, flags);
@@ -3948,7 +3954,7 @@ joinbuf_join(struct JoinBuf *jbuf, struct Channel *chan, unsigned int flags)
       sendcmdto_channel_butserv(jbuf->jb_source, CMD_JOIN, chan, ":%H", chan);
 
       /* send an op, too, if needed */
-      if (jbuf->jb_type == JOINBUF_TYPE_CREATE &&
+      if (!MyUser(jbuf->jb_source) && jbuf->jb_type == JOINBUF_TYPE_CREATE &&
          !IsModelessChannel(chan->chname))
        sendcmdto_channel_butserv(jbuf->jb_source, CMD_MODE, chan, "%H +o %C",
                                  chan, jbuf->jb_source);