summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree
diff options
context:
space:
mode:
authorattilamolnar <attilamolnar@hush.com>2013-06-12 20:08:22 +0200
committerattilamolnar <attilamolnar@hush.com>2013-06-12 20:08:22 +0200
commit98f3924960d849691abc81e0928dc43ad9233b01 (patch)
tree58bccb259cdbec8cb3aa5677eb8d05799ab55bbb /src/modules/m_spanningtree
parentc23d09f65084e6088111dc974f0e290b042de89d (diff)
Change command name parameter of OnPostCommand to be a Command*
Diffstat (limited to 'src/modules/m_spanningtree')
-rw-r--r--src/modules/m_spanningtree/main.h2
-rw-r--r--src/modules/m_spanningtree/postcommand.cpp11
-rw-r--r--src/modules/m_spanningtree/treesocket2.cpp4
-rw-r--r--src/modules/m_spanningtree/utils.h2
4 files changed, 7 insertions, 12 deletions
diff --git a/src/modules/m_spanningtree/main.h b/src/modules/m_spanningtree/main.h
index 21e4e156a..9b827a6ef 100644
--- a/src/modules/m_spanningtree/main.h
+++ b/src/modules/m_spanningtree/main.h
@@ -142,7 +142,7 @@ class ModuleSpanningTree : public Module
**/
ModResult OnPreCommand(std::string &command, std::vector<std::string>& parameters, LocalUser *user, bool validated, const std::string &original_line) CXX11_OVERRIDE;
- void OnPostCommand(const std::string &command, const std::vector<std::string>& parameters, LocalUser *user, CmdResult result, const std::string &original_line) CXX11_OVERRIDE;
+ void OnPostCommand(Command*, const std::vector<std::string>& parameters, LocalUser* user, CmdResult result, const std::string& original_line) CXX11_OVERRIDE;
void OnGetServerDescription(const std::string &servername,std::string &description) CXX11_OVERRIDE;
void OnUserConnect(LocalUser* source) CXX11_OVERRIDE;
void OnUserInvite(User* source,User* dest,Channel* channel, time_t) CXX11_OVERRIDE;
diff --git a/src/modules/m_spanningtree/postcommand.cpp b/src/modules/m_spanningtree/postcommand.cpp
index 551ce06d5..8ff7ce29a 100644
--- a/src/modules/m_spanningtree/postcommand.cpp
+++ b/src/modules/m_spanningtree/postcommand.cpp
@@ -25,20 +25,15 @@
/* $ModDep: m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h */
-void ModuleSpanningTree::OnPostCommand(const std::string &command, const std::vector<std::string>& parameters, LocalUser *user, CmdResult result, const std::string &original_line)
+void ModuleSpanningTree::OnPostCommand(Command* command, const std::vector<std::string>& parameters, LocalUser* user, CmdResult result, const std::string& original_line)
{
if (result == CMD_SUCCESS)
Utils->RouteCommand(NULL, command, parameters, user);
}
-void SpanningTreeUtilities::RouteCommand(TreeServer* origin, const std::string &command, const parameterlist& parameters, User *user)
+void SpanningTreeUtilities::RouteCommand(TreeServer* origin, Command* thiscmd, const parameterlist& parameters, User* user)
{
- if (!ServerInstance->Parser->IsValidCommand(command, parameters.size(), user))
- return;
-
- /* We know it's non-null because IsValidCommand returned true */
- Command* thiscmd = ServerInstance->Parser->GetHandler(command);
-
+ const std::string& command = thiscmd->name;
RouteDescriptor routing = thiscmd->GetRouting(user, parameters);
std::string sent_cmd = command;
diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp
index 42fb708a9..8b8aafd9e 100644
--- a/src/modules/m_spanningtree/treesocket2.cpp
+++ b/src/modules/m_spanningtree/treesocket2.cpp
@@ -464,7 +464,7 @@ void TreeSocket::ProcessConnectedLine(std::string& prefix, std::string& command,
}
}
who->ForceNickChange(params[0]);
- Utils->RouteCommand(route_back_again, command, params, who);
+ Utils->DoOneToAllButSender(prefix, command, params, prefix);
}
else
{
@@ -506,7 +506,7 @@ void TreeSocket::ProcessConnectedLine(std::string& prefix, std::string& command,
SendError("Error handling '" + command + "' -- possibly loaded mismatched modules");
}
else if (res == CMD_SUCCESS)
- Utils->RouteCommand(route_back_again, command, params, who);
+ Utils->RouteCommand(route_back_again, cmd, params, who);
}
}
diff --git a/src/modules/m_spanningtree/utils.h b/src/modules/m_spanningtree/utils.h
index e97df3839..1048e1c87 100644
--- a/src/modules/m_spanningtree/utils.h
+++ b/src/modules/m_spanningtree/utils.h
@@ -124,7 +124,7 @@ class SpanningTreeUtilities : public classbase
*/
~SpanningTreeUtilities();
- void RouteCommand(TreeServer*, const std::string&, const parameterlist&, User*);
+ void RouteCommand(TreeServer*, Command*, const parameterlist&, User*);
/** Send a message from this server to one other local or remote
*/