From b807be32a908850cf9a4cd4aaee1981722c45f9e Mon Sep 17 00:00:00 2001 From: Michael Poole Date: Fri, 15 Jul 2005 03:15:27 +0000 Subject: [PATCH] Update oplevels appropriately on +A/-A. git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1448 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- ChangeLog | 5 +++++ ircd/channel.c | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/ChangeLog b/ChangeLog index 13c6520..e708d41 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-07-14 Michael Poole + + * 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 * include/ircd_features.h: Declare new "his" pseudo-server to hold diff --git a/ircd/channel.c b/ircd/channel.c index 09e3a44..51d1c25 100644 --- a/ircd/channel.c +++ b/ircd/channel.c @@ -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; + } } } } -- 2.20.1