]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_blockamsg.cpp
Merge pull request #357 from StevenVanAcker/insp20
[user/henk/code/inspircd.git] / src / modules / m_blockamsg.cpp
index 1d26b7639344340f83f9727b9cc2f9b024cd4ab7..c570e0a714066fb1ffef750a97515528ba52cb4f 100644 (file)
@@ -98,15 +98,11 @@ class ModuleBlockAmsg : public Module
 
        virtual ModResult OnPreCommand(std::string &command, std::vector<std::string> &parameters, LocalUser *user, bool validated, const std::string &original_line)
        {
-               // Don't do anything with unregistered users, or remote ones.
-               if(!user || (user->registered != REG_ALL) || !IS_LOCAL(user))
+               // Don't do anything with unregistered users
+               if (user->registered != REG_ALL)
                        return MOD_RES_PASSTHRU;
 
-               // We want case insensitive command comparison.
-               // Add std::string contructor for irc::string :x
-               irc::string cmd = command.c_str();
-
-               if(validated && (cmd == "PRIVMSG" || cmd == "NOTICE") && (parameters.size() >= 2))
+               if ((validated) && (parameters.size() >= 2) && ((command == "PRIVMSG") || (command == "NOTICE")))
                {
                        // parameters[0] should have the target(s) in it.
                        // I think it will be faster to first check if there are any commas, and if there are then try and parse it out.