From 471043c5c421b724ca0df68e34bad0dc63831396 Mon Sep 17 00:00:00 2001 From: jantje_85 Date: Sat, 3 Oct 2009 00:32:52 +0000 Subject: git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2525 5417fbe8-f217-4b02-8779-1006273d7864 --- Changes | 1 + src/core/cs_forbid.c | 29 +++++++++++++++++++++++++++-- version.log | 3 ++- 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/Changes b/Changes index b104e8833..87f3229de 100644 --- a/Changes +++ b/Changes @@ -16,6 +16,7 @@ Provided by Anope Dev. - 2009 08/29 F Fixed defcon failing to set and remove modes. [#1101] 08/30 F Fixed MLOCK superseding DEFCON mode lock. [ #00] 09/09 F Fixed number of TS6 compatibility issues. [#1096] +10/03 F Fixed CS FORBID not clearing excepts & invites. [#1097] Provided by Han` - 2009 07/28 F Updated german language file. [ #00] 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; diff --git a/version.log b/version.log index cef2758d7..24b228abe 100644 --- a/version.log +++ b/version.log @@ -9,9 +9,10 @@ VERSION_MAJOR="1" VERSION_MINOR="8" VERSION_PATCH="2" VERSION_EXTRA="-svn" -VERSION_BUILD="2511" +VERSION_BUILD="2525" # $Log$ # Changes since 1.8.2 Release +#Revision 2525 - Fix bug #1097. CS FORBID now clears excepts & invites before banning everyone to avoid rejoin floods. #Revision 2511 - Updated French language file, patch from Saka #Revision 2495 - Fixed a number of TS6 issues, mainly related to nicks instead of IDs being given to anope_cmd_mode() in combination with a status change (Bug #1096). Also Fixed a small bug in os_oline. #Revision 2491 - Fixed typo in install.js so it will correctly detect MySQL 5.1 on Windows -- cgit