diff options
author | rburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-12-17 19:22:19 +0000 |
---|---|---|
committer | rburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-12-17 19:22:19 +0000 |
commit | b9b70be010db39bae3ca79e7cc2a5a405fbefb09 (patch) | |
tree | 8fb012b83d0f7335c069e118cc0e49fb05818e97 | |
parent | 6e53f2c591ada9eecefed4ab4825909b49802d26 (diff) |
Forward-port b00da8a8a5d15f3d96bb2da72c8be7a9caf6861e from 1.8: only set +si on forbidden or suspended channels.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1829 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r-- | src/chanserv.c | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/src/chanserv.c b/src/chanserv.c index d8039eab3..33a2fed16 100644 --- a/src/chanserv.c +++ b/src/chanserv.c @@ -1124,6 +1124,7 @@ int check_kick(User * user, const char *chan, time_t chants) Channel *c; AutoKick *akick; int i; + bool set_modes = false; NickCore *nc; const char *av[4]; int ac; @@ -1138,19 +1139,11 @@ int check_kick(User * user, const char *chan, time_t chants) if (user->isSuperAdmin == 1) return 0; - if (ci->flags & CI_VERBOTEN) { + if (ci->flags & CI_SUSPENDED || ci->flags & CI_VERBOTEN) + { get_idealban(ci, user, mask, sizeof(mask)); - reason = - ci->forbidreason ? ci->forbidreason : getstring(user->na, - CHAN_MAY_NOT_BE_USED); - goto kick; - } - - if (ci->flags & CI_SUSPENDED) { - get_idealban(ci, user, mask, sizeof(mask)); - reason = - ci->forbidreason ? ci->forbidreason : getstring(user->na, - CHAN_MAY_NOT_BE_USED); + reason = ci->forbidreason ? ci->forbidreason : getstring(user->na, CHAN_MAY_NOT_BE_USED); + set_modes = true; goto kick; } @@ -1212,13 +1205,16 @@ int check_kick(User * user, const char *chan, time_t chants) * JOIN would not). */ /* Don't check for CI_INHABIT before for the Channel record cos else * c may be NULL even if it exists */ - if ((!(c = findchan(chan)) || c->usercount == 0) - && !(ci->flags & CI_INHABIT)) { + if ((!(c = findchan(chan)) || c->usercount == 0) && !(ci->flags & CI_INHABIT)) + { ircdproto->SendJoin(findbot(s_ChanServ), chan, (c ? c->creation_time : chants)); - /* Lets hide the channel from /list just incase someone does /list - * while we are here. - katsklaw + /* + * If channel was forbidden, etc, set it +si to prevent rejoin */ - ircdproto->SendMode(findbot(s_ChanServ), chan, "+ntsi"); + if (send_modes) + { + ircdproto->SendMode(findbot(s_ChanServ), chan, "+ntsi"); + } t = add_timeout(CSInhabit, timeout_leave, 0); t->data = sstrdup(chan); ci->flags |= CI_INHABIT; |