summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864>2009-02-07 22:39:10 +0000
committerrburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864>2009-02-07 22:39:10 +0000
commit932391f34e7e3bc9967582c61d0bf98f9c599625 (patch)
treea94e34e38b35f552b8f3699aa747b2d3798c0b79
parent226710743e071cb57cb29a50bc1134030c0a5e55 (diff)
Forward-port r1946: 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/trunk@1947 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r--src/channels.c17
-rw-r--r--src/core/cs_modes.c2
2 files changed, 14 insertions, 5 deletions
diff --git a/src/channels.c b/src/channels.c
index 350c60fd3..4d5c08b5a 100644
--- a/src/channels.c
+++ b/src/channels.c
@@ -303,18 +303,27 @@ void chan_set_modes(const char *source, Channel * chan, int ac, const char **av,
}
}
- if (check > 0) {
+ 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++) {
+ 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 (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 d86b3b336..090cc7afe 100644
--- a/src/core/cs_modes.c
+++ b/src/core/cs_modes.c
@@ -359,7 +359,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)
ircdproto->SendMessage(whosends(ci), c->name, "%s command used for %s by %s",