summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree
diff options
context:
space:
mode:
authorlinuxdaemon <linuxdaemon@snoonet.org>2019-04-27 17:35:31 -0500
committerPeter Powell <petpow@saberuk.com>2019-04-28 00:01:25 +0100
commit095d0e615474a08455c6bc186fbdf8b1bc753e39 (patch)
tree3339de289694ecd7deaf72b7f57e08d910781b33 /src/modules/m_spanningtree
parentd4aab8d30a4721623ccb02d7bb801dfe271f8e36 (diff)
m_spanningtree: Parse and copy message tags for all cmds
Don't ignore message tags on ServerCommands, and avoid creating duplicate CommandBase::Params instances
Diffstat (limited to 'src/modules/m_spanningtree')
-rw-r--r--src/modules/m_spanningtree/treesocket2.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp
index aeb63c99c..364586dff 100644
--- a/src/modules/m_spanningtree/treesocket2.cpp
+++ b/src/modules/m_spanningtree/treesocket2.cpp
@@ -377,21 +377,24 @@ void TreeSocket::ProcessConnectedLine(std::string& taglist, std::string& prefix,
CmdResult res;
ClientProtocol::TagMap tags;
+ std::string tag;
+ irc::sepstream tagstream(taglist, ';');
+ while (tagstream.GetToken(tag))
+ ProcessTag(who, tag, tags);
+
+ CommandBase::Params newparams(params, tags);
+
if (scmd)
- res = scmd->Handle(who, params);
+ res = scmd->Handle(who, newparams);
else
{
- std::string tag;
- irc::sepstream tagstream(taglist, ';');
- while (tagstream.GetToken(tag))
- ProcessTag(who, tag, tags);
- res = cmd->Handle(who, CommandBase::Params(params, tags));
+ res = cmd->Handle(who, newparams);
if (res == CMD_INVALID)
throw ProtocolException("Error in command handler");
}
if (res == CMD_SUCCESS)
- Utils->RouteCommand(server->GetRoute(), cmdbase, CommandBase::Params(params, tags), who);
+ Utils->RouteCommand(server->GetRoute(), cmdbase, newparams, who);
}
void TreeSocket::OnTimeout()