diff options
author | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-10-25 16:41:11 +0000 |
---|---|---|
committer | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-10-25 16:41:11 +0000 |
commit | 813c8981600b440a7cf762607fa6518b9e9b3d56 (patch) | |
tree | 5660308258fd79305a8cc293f17d6129beea9040 /src/command_parse.cpp | |
parent | bde833f1827cfc5367602a580d23afcafc12d15b (diff) |
By moving OnPreCommand call in two places, modules (even with unverified commands) can still recieve the command with max_params at most if it exists.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10716 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/command_parse.cpp')
-rw-r--r-- | src/command_parse.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/command_parse.cpp b/src/command_parse.cpp index 984ce2314..fd1039088 100644 --- a/src/command_parse.cpp +++ b/src/command_parse.cpp @@ -277,21 +277,18 @@ bool CommandParser::ProcessCommand(User *user, std::string &cmd) std::transform(command.begin(), command.end(), command.begin(), ::toupper); - int MOD_RESULT = 0; - FOREACH_RESULT(I_OnPreCommand,OnPreCommand(command, command_p, user, false, cmd)); - if (MOD_RESULT == 1) { - return true; - } - /* find the command, check it exists */ Commandtable::iterator cm = cmdlist.find(command); if (cm == cmdlist.end()) { + int MOD_RESULT = 0; + FOREACH_RESULT(I_OnPreCommand,OnPreCommand(command, command_p, user, false, cmd)); + if (MOD_RESULT == 1) + return true; + if (user->registered == REG_ALL) - { user->WriteNumeric(ERR_UNKNOWNCOMMAND, "%s %s :Unknown command",user->nick.c_str(),command.c_str()); - } ServerInstance->stats->statsUnknown++; return true; } @@ -333,6 +330,11 @@ bool CommandParser::ProcessCommand(User *user, std::string &cmd) command_p.push_back(lparam); } + int MOD_RESULT = 0; + FOREACH_RESULT(I_OnPreCommand,OnPreCommand(command, command_p, user, false, cmd)); + if (MOD_RESULT == 1) + return true; + /* Modify the user's penalty */ bool do_more = true; if (!user->ExemptFromPenalty) |