1
0
mirror of https://github.com/anope/anope.git synced 2026-07-07 03:23:13 +02:00

Forward port of bugfix #1097. CS FORBID now clears excepts & invites before banning everyone to avoid rejoin floods.

git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2526 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
jantje_85
2009-10-03 00:54:51 +00:00
parent dc4b9afebb
commit d02f03a7a8
+22
View File
@@ -29,6 +29,7 @@ class CommandCSForbid : public Command
const char *reason = params.size() > 1 ? params[1].c_str() : NULL;
Channel *c;
Entry *cur, *enext;
if (ForceForbidReason && !reason)
{
@@ -75,6 +76,27 @@ class CommandCSForbid : public Command
struct c_userlist *cu, *nextu;
const 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) {
for (cur = c->excepts->entries; cur; cur = enext) {
enext = cur->next;
av[0] = "-e";
av[1] = cur->mask;
ircdproto->SendMode(whosends(ci), chan, "-e %s", cur->mask);
chan_set_modes(whosends(ci)->nick, c, 2, av, 0);
}
}
if (ircd->invitemode && c->invites && c->invites->count) {
for (cur = c->invites->entries; cur; cur = enext) {
enext = cur->next;
av[0] = "-I";
av[1] = cur->mask;
ircdproto->SendMode(whosends(ci), chan, "-I %s", cur->mask);
chan_set_modes(whosends(ci)->nick, c, 2, av, 0);
}
}
for (cu = c->users; cu; cu = nextu)
{
nextu = cu->next;