X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_remove.cpp;h=35b7fbf0379e565d069f18daf393ef320f5a1e96;hb=780dda83ba3857bc3c330d4b5d38bb251a9d879b;hp=d643bc0cd46475c0130c2bd5a175d85863711ec7;hpb=0412378109ae9f618e47b2bb60729c0d8f29fe8d;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_remove.cpp b/src/modules/m_remove.cpp index d643bc0cd..35b7fbf03 100644 --- a/src/modules/m_remove.cpp +++ b/src/modules/m_remove.cpp @@ -74,9 +74,14 @@ class RemoveBase : public Command channel = ServerInstance->FindChan(channame); /* Fix by brain - someone needs to learn to validate their input! */ - if ((!target) || (target->registered != REG_ALL) || (!channel)) + if (!channel) { - user->WriteNumeric(Numerics::NoSuchNick(channel ? username.c_str() : channame.c_str())); + user->WriteNumeric(Numerics::NoSuchChannel(channame)); + return CMD_FAILURE; + } + if ((!target) || (target->registered != REG_ALL)) + { + user->WriteNumeric(Numerics::NoSuchNick(username)); return CMD_FAILURE; } @@ -108,7 +113,7 @@ class RemoveBase : public Command if (!IS_LOCAL(target)) { // Send an ENCAP REMOVE with parameters being in the old order which is - // compatible with both 2.0 and 2.2. This also turns FPART into REMOVE. + // compatible with both 2.0 and 3.0. This also turns FPART into REMOVE. std::vector p; p.push_back(target->uuid); p.push_back(channel->name); @@ -164,7 +169,7 @@ class CommandRemove : public RemoveBase TRANSLATE3(TR_NICK, TR_TEXT, TR_TEXT); } - CmdResult Handle (const std::vector& parameters, User *user) + CmdResult Handle(const std::vector& parameters, User* user) CXX11_OVERRIDE { return HandleRMB(parameters, user, false); } @@ -182,7 +187,7 @@ class CommandFpart : public RemoveBase TRANSLATE3(TR_TEXT, TR_NICK, TR_TEXT); } - CmdResult Handle (const std::vector& parameters, User *user) + CmdResult Handle(const std::vector& parameters, User* user) CXX11_OVERRIDE { return HandleRMB(parameters, user, true); } @@ -212,7 +217,7 @@ class ModuleRemove : public Module { ConfigTag* tag = ServerInstance->Config->ConfValue("remove"); supportnokicks = tag->getBool("supportnokicks"); - cmd1.protectedrank = cmd2.protectedrank = tag->getInt("protectedrank", 50000); + cmd1.protectedrank = cmd2.protectedrank = tag->getUInt("protectedrank", 50000); } Version GetVersion() CXX11_OVERRIDE