Update oplevels appropriately on +A/-A.
authorMichael Poole <mdpoole@troilus.org>
Fri, 15 Jul 2005 03:15:27 +0000 (03:15 +0000)
committerMichael Poole <mdpoole@troilus.org>
Fri, 15 Jul 2005 03:15:27 +0000 (03:15 +0000)
git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1448 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
ircd/channel.c

index 13c6520c116ec10671e29ddab138ebe3b43c954b..e708d41dbd51c7a516408c609fcfc23ed4b3397c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-07-14  Michael Poole <mdpoole@troilus.org>
+
+       * ircd/channel.c (mode_parse_apass): Update oplevels when setting
+       or removing the +A password.  Partial credit goes to Reed Loden.
+
 2005-07-14  Michael Poole <mdpoole@troilus.org>
 
        * include/ircd_features.h: Declare new "his" pseudo-server to hold
index 09e3a4484dc848d79087cbe15a0835b4297b6fc4..51d1c25340aadd43496dadaa6149df7c0e35da4e 100644 (file)
@@ -2537,6 +2537,7 @@ mode_parse_upass(struct ParseState *state, int *flag_p)
 static void
 mode_parse_apass(struct ParseState *state, int *flag_p)
 {
+  struct Membership *memb;
   char *t_str, *s;
   int t_len;
 
@@ -2645,10 +2646,18 @@ mode_parse_apass(struct ParseState *state, int *flag_p)
        send_reply(state->sptr, RPL_APASSWARN_SECRET, state->chptr->chname,
                    state->chptr->mode.apass);
       }
+      /* Give the channel manager level 0 ops. */
+      if (!(state->flags & MODE_PARSE_FORCE) && IsChannelManager(state->member))
+        SetOpLevel(state->member, 0);
     } else { /* remove the old apass */
       *state->chptr->mode.apass = '\0';
       if (MyUser(state->sptr))
         send_reply(state->sptr, RPL_APASSWARN_CLEAR);
+      /* Revert everyone to MAXOPLEVEL. */
+      for (memb = state->chptr->members; memb; memb = memb->next_member) {
+        if (memb->status & MODE_CHANOP)
+          memb->oplevel = MAXOPLEVEL;
+      }
     }
   }
 }