diff options
-rw-r--r-- | include/modules.h | 3 | ||||
-rw-r--r-- | src/command_parse.cpp | 8 | ||||
-rw-r--r-- | src/modules.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_spanningtree/main.h | 2 | ||||
-rw-r--r-- | src/modules/m_spanningtree/postcommand.cpp | 2 |
5 files changed, 9 insertions, 8 deletions
diff --git a/include/modules.h b/include/modules.h index 3cd0179d2..db0bc341e 100644 --- a/include/modules.h +++ b/include/modules.h @@ -717,8 +717,9 @@ class CoreExport Module : public classbase, public usecountbase * @param parameters An array of array of characters containing the parameters for the command * @param user the user issuing the command * @param result The return code given by the command handler, one of CMD_SUCCESS or CMD_FAILURE + * @param loop Whether the command is being called from LoopCall or directly. */ - virtual void OnPostCommand(Command* command, const CommandBase::Params& parameters, LocalUser* user, CmdResult result); + virtual void OnPostCommand(Command* command, const CommandBase::Params& parameters, LocalUser* user, CmdResult result, bool loop); /** Called when a user is first connecting, prior to starting DNS lookups, checking initial * connect class, or accepting any commands. diff --git a/src/command_parse.cpp b/src/command_parse.cpp index 503630d53..d4dd7da21 100644 --- a/src/command_parse.cpp +++ b/src/command_parse.cpp @@ -97,10 +97,10 @@ bool CommandParser::LoopCall(User* user, Command* handler, const CommandBase::Pa CmdResult result = handler->Handle(user, params); if (localuser) { - // Run the OnPostCommand hook with the last parameter (original line) being empty - // to indicate that the command had more targets in its original form. + // Run the OnPostCommand hook with the last parameter being true to indicate + // that the event is being called in a loop. item.clear(); - FOREACH_MOD(OnPostCommand, (handler, new_parameters, localuser, result)); + FOREACH_MOD(OnPostCommand, (handler, new_parameters, localuser, result, true)); } } } @@ -316,7 +316,7 @@ void CommandParser::ProcessCommand(LocalUser* user, std::string& command, Comman */ CmdResult result = handler->Handle(user, command_p); - FOREACH_MOD(OnPostCommand, (handler, command_p, user, result)); + FOREACH_MOD(OnPostCommand, (handler, command_p, user, result, false)); } } diff --git a/src/modules.cpp b/src/modules.cpp index 3a574fdda..3062aad43 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -94,7 +94,7 @@ void Module::OnLoadModule(Module*) { DetachEvent(I_OnLoadModule); } void Module::OnUnloadModule(Module*) { DetachEvent(I_OnUnloadModule); } void Module::OnBackgroundTimer(time_t) { DetachEvent(I_OnBackgroundTimer); } ModResult Module::OnPreCommand(std::string&, CommandBase::Params&, LocalUser*, bool) { DetachEvent(I_OnPreCommand); return MOD_RES_PASSTHRU; } -void Module::OnPostCommand(Command*, const CommandBase::Params&, LocalUser*, CmdResult) { DetachEvent(I_OnPostCommand); } +void Module::OnPostCommand(Command*, const CommandBase::Params&, LocalUser*, CmdResult, bool) { DetachEvent(I_OnPostCommand); } void Module::OnUserInit(LocalUser*) { DetachEvent(I_OnUserInit); } ModResult Module::OnCheckReady(LocalUser*) { DetachEvent(I_OnCheckReady); return MOD_RES_PASSTHRU; } ModResult Module::OnUserRegister(LocalUser*) { DetachEvent(I_OnUserRegister); return MOD_RES_PASSTHRU; } diff --git a/src/modules/m_spanningtree/main.h b/src/modules/m_spanningtree/main.h index 60f819e9c..d619c43bc 100644 --- a/src/modules/m_spanningtree/main.h +++ b/src/modules/m_spanningtree/main.h @@ -146,7 +146,7 @@ class ModuleSpanningTree **/ ModResult OnPreCommand(std::string& command, CommandBase::Params& parameters, LocalUser* user, bool validated) CXX11_OVERRIDE; - void OnPostCommand(Command*, const CommandBase::Params& parameters, LocalUser* user, CmdResult result) CXX11_OVERRIDE; + void OnPostCommand(Command*, const CommandBase::Params& parameters, LocalUser* user, CmdResult result, bool loop) CXX11_OVERRIDE; void OnUserConnect(LocalUser* source) CXX11_OVERRIDE; void OnUserInvite(User* source, User* dest, Channel* channel, time_t timeout, unsigned int notifyrank, CUList& notifyexcepts) CXX11_OVERRIDE; ModResult OnPreTopicChange(User* user, Channel* chan, const std::string& topic) CXX11_OVERRIDE; diff --git a/src/modules/m_spanningtree/postcommand.cpp b/src/modules/m_spanningtree/postcommand.cpp index c6bc04fc2..c7b4707b3 100644 --- a/src/modules/m_spanningtree/postcommand.cpp +++ b/src/modules/m_spanningtree/postcommand.cpp @@ -24,7 +24,7 @@ #include "treeserver.h" #include "commandbuilder.h" -void ModuleSpanningTree::OnPostCommand(Command* command, const CommandBase::Params& parameters, LocalUser* user, CmdResult result) +void ModuleSpanningTree::OnPostCommand(Command* command, const CommandBase::Params& parameters, LocalUser* user, CmdResult result, bool loop) { if (result == CMD_SUCCESS) Utils->RouteCommand(NULL, command, parameters, user); |