X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_dccallow.cpp;h=f011fa44929320dc8de13a79dc32296d8367fba7;hb=df9bd50866a1ee95db78b88090aae74e245ad469;hp=cc7fbd323020b50757b466de89d11a66526324da;hpb=3a3ff949670c61a4a8856e1391222e156eb1cd17;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_dccallow.cpp b/src/modules/m_dccallow.cpp index cc7fbd323..f011fa449 100644 --- a/src/modules/m_dccallow.cpp +++ b/src/modules/m_dccallow.cpp @@ -101,7 +101,7 @@ class CommandDccallow : public Command } } - std::string nick = parameters[0].substr(1); + std::string nick(parameters[0], 1); User *target = ServerInstance->FindNickOnly(nick); if ((target) && (!IS_SERVER(target)) && (!target->quitting) && (target->registered == REG_ALL)) @@ -257,7 +257,7 @@ class ModuleDCCAllow : public Module public: ModuleDCCAllow() - : ext("dccallow", this) + : ext("dccallow", ExtensionItem::EXT_USER, this) , cmd(this, ext) { } @@ -268,11 +268,7 @@ class ModuleDCCAllow : public Module // remove their DCCALLOW list if they have one if (udl) - { - userlist::iterator it = std::find(ul.begin(), ul.end(), user); - if (it != ul.end()) - ul.erase(it); - } + stdalgo::erase(ul, user); // remove them from any DCCALLOW lists // they are currently on @@ -322,6 +318,9 @@ class ModuleDCCAllow : public Module while (ss >> buf) tokens.push_back(buf); + if (tokens.size() < 2) + return MOD_RES_PASSTHRU; + irc::string type = tokens[1].c_str(); ConfigTag* conftag = ServerInstance->Config->ConfValue("dccallow"); @@ -329,6 +328,9 @@ class ModuleDCCAllow : public Module if (type == "SEND") { + if (tokens.size() < 3) + return MOD_RES_PASSTHRU; + std::string defaultaction = conftag->getString("action"); std::string filename = tokens[2];