summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjantje_85 <jantje_85@5417fbe8-f217-4b02-8779-1006273d7864>2009-10-03 00:54:51 +0000
committerjantje_85 <jantje_85@5417fbe8-f217-4b02-8779-1006273d7864>2009-10-03 00:54:51 +0000
commitd02f03a7a8e89e8173c5456692338e469d5ddc80 (patch)
tree80f6fc16568912c7c1caade0df147367581c8c0c
parentdc4b9afebbea5c8ca2d5b86c84411153b1622f71 (diff)
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
-rw-r--r--src/core/cs_forbid.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/core/cs_forbid.c b/src/core/cs_forbid.c
index c463551dd..d1ce0d119 100644
--- a/src/core/cs_forbid.c
+++ b/src/core/cs_forbid.c
@@ -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;