]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/command_parse.cpp
Change the syntax of FOREACH macros to be less dumb.
[user/henk/code/inspircd.git] / src / command_parse.cpp
index 31e61d161c8ef98ab7a66a75f41c2a8e325de2ad..51358519bf3f9983cb2d5d66f158e2bc8d065fe3 100644 (file)
@@ -100,7 +100,7 @@ bool CommandParser::LoopCall(User* user, Command* handler, const std::vector<std
                                // Run the OnPostCommand hook with the last parameter (original line) being empty
                                // to indicate that the command had more targets in its original form.
                                item.clear();
-                               FOREACH_MOD(I_OnPostCommand, OnPostCommand(handler, new_parameters, localuser, result, item));
+                               FOREACH_MOD(OnPostCommand, (handler, new_parameters, localuser, result, item));
                        }
                }
        }
@@ -108,30 +108,6 @@ bool CommandParser::LoopCall(User* user, Command* handler, const std::vector<std
        return true;
 }
 
-bool CommandParser::IsValidCommand(const std::string &commandname, unsigned int pcnt, User * user)
-{
-       Commandtable::iterator n = cmdlist.find(commandname);
-
-       if (n != cmdlist.end())
-       {
-               if ((pcnt >= n->second->min_params))
-               {
-                       if (IS_LOCAL(user) && n->second->flags_needed)
-                       {
-                               if (user->IsModeSet(n->second->flags_needed))
-                               {
-                                       return (user->HasPermission(commandname));
-                               }
-                       }
-                       else
-                       {
-                               return true;
-                       }
-               }
-       }
-       return false;
-}
-
 Command* CommandParser::GetHandler(const std::string &commandname)
 {
        Commandtable::iterator n = cmdlist.find(commandname);
@@ -340,7 +316,7 @@ void CommandParser::ProcessCommand(LocalUser *user, std::string &cmd)
                 */
                CmdResult result = handler->Handle(command_p, user);
 
-               FOREACH_MOD(I_OnPostCommand, OnPostCommand(handler, command_p, user, result, cmd));
+               FOREACH_MOD(OnPostCommand, (handler, command_p, user, result, cmd));
        }
 }