aboutsummaryrefslogtreecommitdiff
path: root/src/modules/m_timedbans.cpp
diff options
context:
space:
mode:
authorGravatar attilamolnar2013-04-03 19:10:18 +0200
committerGravatar attilamolnar2013-04-08 23:13:24 +0200
commitebe5b201aab71cf2ead1e068889be736314fbb73 (patch)
tree33bc1cc227073304f5e25731fa35a60cfd2712a3 /src/modules/m_timedbans.cpp
parentAdd builtin modes using AddService() (diff)
Migrate u_listmode.h into the core, change +b to use it
Diffstat (limited to 'src/modules/m_timedbans.cpp')
-rw-r--r--src/modules/m_timedbans.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/modules/m_timedbans.cpp b/src/modules/m_timedbans.cpp
index 81b12d881..a3ee9b525 100644
--- a/src/modules/m_timedbans.cpp
+++ b/src/modules/m_timedbans.cpp
@@ -80,20 +80,17 @@ class CommandTban : public Command
bool isextban = ((mask.size() > 2) && (mask[1] == ':'));
if (!isextban && !ServerInstance->IsValidMask(mask))
mask.append("!*@*");
- if ((mask.length() > 250) || (!ServerInstance->IsValidMask(mask) && !isextban))
- {
- user->WriteServ("NOTICE "+user->nick+" :Invalid ban mask");
- return CMD_FAILURE;
- }
+
setban.push_back(mask);
// use CallHandler to make it so that the user sets the mode
// themselves
ServerInstance->Parser->CallHandler("MODE",setban,user);
- for (BanList::iterator i = channel->bans.begin(); i != channel->bans.end(); i++)
- if (!strcasecmp(i->data.c_str(), mask.c_str()))
- goto found;
- return CMD_FAILURE;
-found:
+ if (ServerInstance->Modes->GetLastParse().empty())
+ {
+ user->WriteServ("NOTICE "+user->nick+" :Invalid ban mask");
+ return CMD_FAILURE;
+ }
+
CUList tmp;
T.channel = channelname;
T.mask = mask;