From 095d0e615474a08455c6bc186fbdf8b1bc753e39 Mon Sep 17 00:00:00 2001 From: linuxdaemon Date: Sat, 27 Apr 2019 17:35:31 -0500 Subject: m_spanningtree: Parse and copy message tags for all cmds Don't ignore message tags on ServerCommands, and avoid creating duplicate CommandBase::Params instances --- src/modules/m_spanningtree/treesocket2.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/modules/m_spanningtree') 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() -- cgit v1.2.3