summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864>2009-02-07 22:32:02 +0000
committerrburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864>2009-02-07 22:32:02 +0000
commit6c801d57803fcbf3064c1cc1a021c52579f62170 (patch)
treef53057ee1eb2e83b59cdb6a09be706e7f90bb904 /src
parent0b76c8b5e60d2efeaa587ec6240f4117ad250b35 (diff)
Patch by Adam fixing #1006 (originally caused by #922): modes set by ChanServ are reversed. Thanks!
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@1946 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r--src/channels.c10
-rw-r--r--src/core/cs_modes.c2
2 files changed, 8 insertions, 4 deletions
diff --git a/src/channels.c b/src/channels.c
index f16c56388..bb23d45a7 100644
--- a/src/channels.c
+++ b/src/channels.c
@@ -305,15 +305,19 @@ void chan_set_modes(const char *source, Channel * chan, int ac, char **av,
if (check > 0) {
check_modes(chan);
- if (check < 2) {
+ if ((check < 2) || (check == 3)) {
/* Walk through all users we've set modes for and see if they are
* valid. Invalid modes (like +o with SECUREOPS on) will be removed
*/
real_ac--;
real_av++;
for (i = 0; i < real_ac; i++) {
- if ((user = finduser(*real_av)) && is_on_chan(chan, user))
- chan_set_correct_modes(user, chan, 0);
+ if ((user = finduser(*real_av)) && is_on_chan(chan, user)) {
+ if (check < 2)
+ chan_set_correct_modes(user, chan, 0);
+ else if ((chan->ci->flags) && (chan->ci->flags & CI_SECUREOPS))
+ chan_set_correct_modes(user, chan, 0);
+ }
real_av++;
}
}
diff --git a/src/core/cs_modes.c b/src/core/cs_modes.c
index 47fd0e571..22460291a 100644
--- a/src/core/cs_modes.c
+++ b/src/core/cs_modes.c
@@ -382,7 +382,7 @@ int do_util(User * u, CSModeUtil * util)
av[0] = util->mode;
av[1] = u2->nick;
- chan_set_modes(s_ChanServ, c, 2, av, 2);
+ chan_set_modes(s_ChanServ, c, 2, av, 3);
if (util->notice && ci->flags & util->notice)
notice(whosends(ci), c->name, "%s command used for %s by %s",