-std::string TreeSocket::GetName()
-{
- std::string sourceserv = this->myhost;
- if (!this->InboundServerName.empty())
- {
- sourceserv = this->InboundServerName;
+ if ((!params.empty()) && (params.back().empty()) && (!cmd->allow_empty_last_param))
+ {
+ // the last param is empty and the command handler doesn't allow that, check if there will be enough params if we drop the last
+ if (params.size()-1 < cmd->min_params)
+ return;
+ params.pop_back();
+ }
+
+ CmdResult res = cmd->Handle(params, who);
+
+ if (res == CMD_INVALID)
+ {
+ irc::stringjoiner pmlist(params);
+ ServerInstance->Logs->Log("m_spanningtree", LOG_SPARSE, "Error handling S2S command :%s %s %s",
+ who->uuid.c_str(), command.c_str(), pmlist.GetJoined().c_str());
+ SendError("Error handling '" + command + "' -- possibly loaded mismatched modules");
+ }
+ else if (res == CMD_SUCCESS)
+ Utils->RouteCommand(route_back_again, cmd, params, who);