summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2019-01-19 12:55:31 +0000
committerPeter Powell <petpow@saberuk.com>2019-01-19 13:10:56 +0000
commit25b3686f43d2a0dcc40157d7119a80b783a07f8f (patch)
tree0aea94b04703267605aafeaa5d67f20dcb813d12 /src
parent0527f858cecb05a79b6405b6d353a460a4946f7f (diff)
Fix sending the entire VERSION output as a single parameter.
Closes #1560.
Diffstat (limited to 'src')
-rw-r--r--src/coremods/core_info/cmd_version.cpp8
-rw-r--r--src/modules/m_spanningtree/main.cpp8
2 files changed, 12 insertions, 4 deletions
diff --git a/src/coremods/core_info/cmd_version.cpp b/src/coremods/core_info/cmd_version.cpp
index 29d96169e..57f9b05cf 100644
--- a/src/coremods/core_info/cmd_version.cpp
+++ b/src/coremods/core_info/cmd_version.cpp
@@ -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)
{
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp
index 985762872..de1e8eb19 100644
--- a/src/modules/m_spanningtree/main.cpp
+++ b/src/modules/m_spanningtree/main.cpp
@@ -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
{