diff options
| author | jantje_85 <jantje_85@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-10-03 00:32:52 +0000 |
|---|---|---|
| committer | jantje_85 <jantje_85@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-10-03 00:32:52 +0000 |
| commit | 471043c5c421b724ca0df68e34bad0dc63831396 (patch) | |
| tree | 28f05366b91877132648a17f7bb2304d45863e3b /src | |
| parent | 29c8702c3525392d4bbbcbdc32c981010ee33324 (diff) | |
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2525 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/cs_forbid.c | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/src/core/cs_forbid.c b/src/core/cs_forbid.c index 4740478e3..e4f46868d 100644 --- a/src/core/cs_forbid.c +++ b/src/core/cs_forbid.c @@ -68,11 +68,11 @@ void myChanServHelp(User * u) **/ int do_forbid(User * u) { + Channel *c; ChannelInfo *ci; char *chan = strtok(NULL, " "); char *reason = strtok(NULL, ""); - - Channel *c; + Entry *cur, *enext; /* Assumes that permission checking has already been done. */ if (!chan || (ForceForbidReason && !reason)) { @@ -103,6 +103,31 @@ int do_forbid(User * u) struct c_userlist *cu, *next; char *av[3]; + /* Before banning everyone, it might be prudent to clear +e and +I lists.. + * to prevent ppl from rejoining.. ~ Viper */ + if (ircd->except && c->excepts && c->excepts->count) { + av[0] = sstrdup("-e"); + for (cur = c->excepts->entries; cur; cur = enext) { + enext = cur->next; + av[1] = sstrdup(cur->mask); + anope_cmd_mode(whosends(ci), chan, "-e %s", cur->mask); + chan_set_modes(whosends(ci), c, 2, av, 0); + free(av[1]); + } + free(av[0]); + } + if (ircd->invitemode && c->invites && c->invites->count) { + av[0] = sstrdup("-I"); + for (cur = c->invites->entries; cur; cur = enext) { + enext = cur->next; + av[1] = sstrdup(cur->mask); + anope_cmd_mode(whosends(ci), chan, "-I %s", cur->mask); + chan_set_modes(whosends(ci), c, 2, av, 0); + free(av[1]); + } + free(av[0]); + } + for (cu = c->users; cu; cu = next) { next = cu->next; |
