Fix sending the entire VERSION output as a single parameter.

Closes #1560.
This commit is contained in:
Peter Powell 2019-01-19 12:55:31 +00:00
parent 0527f858ce
commit 25b3686f43
2 changed files with 12 additions and 4 deletions

View File

@ -29,8 +29,12 @@ CommandVersion::CommandVersion(Module* parent)
CmdResult CommandVersion::Handle(User* user, const Params& parameters)
{
std::string version = ServerInstance->GetVersionString((user->IsOper()));
user->WriteNumeric(RPL_VERSION, version);
Numeric::Numeric numeric(RPL_VERSION);
irc::tokenstream tokens(ServerInstance->GetVersionString(user->IsOper()));
for (std::string token; tokens.GetTrailing(token); )
numeric.push(token);
user->WriteNumeric(numeric);
LocalUser *lu = IS_LOCAL(user);
if (lu != NULL)
{

View File

@ -324,8 +324,12 @@ ModResult ModuleSpanningTree::HandleVersion(const CommandBase::Params& parameter
// If it's empty it might be that the server is still syncing (full version hasn't arrived yet)
// or the server is a 2.0 server and does not send a full version.
bool showfull = ((user->IsOper()) && (!found->GetFullVersion().empty()));
const std::string& Version = (showfull ? found->GetFullVersion() : found->GetVersion());
user->WriteNumeric(RPL_VERSION, Version);
Numeric::Numeric numeric(RPL_VERSION);
irc::tokenstream tokens(showfull ? found->GetFullVersion() : found->GetVersion());
for (std::string token; tokens.GetTrailing(token); )
numeric.push(token);
user->WriteNumeric(numeric);
}
else
{