+ if (params.size() < cmd->min_params)
+ {
+ irc::stringjoiner pmlist(" ", params, 0, params.size() - 1);
+ ServerInstance->Logs->Log("m_spanningtree", LOG_SPARSE, "Insufficient parameters for S2S command :%s %s %s",
+ who->uuid.c_str(), command.c_str(), pmlist.GetJoined().c_str());
+ SendError("Insufficient parameters for command '" + command + "'");
+ return;
+ }
+
+ 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);
+