]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_remove.cpp
Add ConfigTag::getUInt for reading unsigned config values.
[user/henk/code/inspircd.git] / src / modules / m_remove.cpp
index dfe6247020cef4ed716e6a511e75346a244011fb..35b7fbf0379e565d069f18daf393ef320f5a1e96 100644 (file)
@@ -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;
                }
 
@@ -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