inspircd

A modular C++ IRC daemon (ircd). https://www.inspircd.org/
Log | Files | Refs | README

commit 095d0e615474a08455c6bc186fbdf8b1bc753e39
parent d4aab8d30a4721623ccb02d7bb801dfe271f8e36
Author: linuxdaemon <linuxdaemon@snoonet.org>
Date:   Sat, 27 Apr 2019 17:35:31 -0500

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:
Msrc/modules/m_spanningtree/treesocket2.cpp | 17++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)

diff --git 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()