]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/postcommand.cpp
Replace ModuleSpanningTree::TimeToStr with InspIRCd::DurationStr.
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / postcommand.cpp
index 64ca729779249cd2a44e8bb8fc80db9119719d71..d3eab825fec48ec09ed1c7124f152eb240e99a12 100644 (file)
 #include "treeserver.h"
 #include "commandbuilder.h"
 
-void ModuleSpanningTree::OnPostCommand(Command* command, const std::vector<std::string>& parameters, LocalUser* user, CmdResult result, const std::string& original_line)
+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);
 }
 
-void SpanningTreeUtilities::RouteCommand(TreeServer* origin, CommandBase* thiscmd, const parameterlist& parameters, User* user)
+void SpanningTreeUtilities::RouteCommand(TreeServer* origin, CommandBase* thiscmd, const CommandBase::Params& parameters, User* user)
 {
        const std::string& command = thiscmd->name;
        RouteDescriptor routing = thiscmd->GetRouting(user, parameters);
@@ -39,6 +39,7 @@ void SpanningTreeUtilities::RouteCommand(TreeServer* origin, CommandBase* thiscm
 
        const bool encap = ((routing.type == ROUTE_TYPE_OPT_BCAST) || (routing.type == ROUTE_TYPE_OPT_UCAST));
        CmdBuilder params(user, encap ? "ENCAP" : command.c_str());
+       params.push_tags(parameters.GetTags());
        TreeServer* sdest = NULL;
 
        if (routing.type == ROUTE_TYPE_OPT_BCAST)
@@ -100,7 +101,10 @@ void SpanningTreeUtilities::RouteCommand(TreeServer* origin, CommandBase* thiscm
                                return;
                        // TODO OnBuildExemptList hook was here
                        CUList exempts;
-                       SendChannelMessage(user->uuid, c, parameters[1], pfx, exempts, command.c_str(), origin ? origin->GetSocket() : NULL);
+                       std::string message;
+                       if (parameters.size() >= 2)
+                               message.assign(parameters[1]);
+                       SendChannelMessage(user->uuid, c, message, pfx, parameters.GetTags(), exempts, command.c_str(), origin ? origin->GetSocket() : NULL);
                }
                else if (dest[0] == '$')
                {