]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_timedbans.cpp
m_spanningtree Remove unneeded #includes
[user/henk/code/inspircd.git] / src / modules / m_timedbans.cpp
index 81b12d8816a99db076f5e8c1453df79c52b0a360..a3ee9b525e33941ab651290fd183f4419da190bf 100644 (file)
@@ -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;