summaryrefslogtreecommitdiff
path: root/modules/core/cs_forbid.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/core/cs_forbid.cpp')
-rw-r--r--modules/core/cs_forbid.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/modules/core/cs_forbid.cpp b/modules/core/cs_forbid.cpp
index ef55439b2..25fd90868 100644
--- a/modules/core/cs_forbid.cpp
+++ b/modules/core/cs_forbid.cpp
@@ -63,12 +63,16 @@ class CommandCSForbid : public Command
ci->forbidby = u->nick;
ci->forbidreason = reason;
- if ((c = findchan(ci->name)))
+ if ((c = ci->c))
{
/* Before banning everyone, it might be prudent to clear +e and +I lists..
* to prevent ppl from rejoining.. ~ Viper */
- c->ClearExcepts();
- c->ClearInvites();
+ std::pair<Channel::ModeList::iterator, Channel::ModeList::iterator> modes = c->GetModeList(CMODE_EXCEPT);
+ for (; modes.first != modes.second; ++modes.first)
+ c->RemoveMode(NULL, CMODE_EXCEPT, modes.first->second);
+ modes = c->GetModeList(CMODE_INVITEOVERRIDE);
+ for (; modes.first != modes.second; ++modes.first)
+ c->RemoveMode(NULL, CMODE_INVITEOVERRIDE, modes.first->second);
for (CUserList::iterator it = c->users.begin(), it_end = c->users.end(); it != it_end; )
{