From 04fba25ada45f787ff6c93f813912b81a257538a Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Tue, 17 May 2022 20:06:21 +0100 Subject: Deprecate the (raw)version SINFO keys and split out customversion/rawbranch. --- src/modules/m_spanningtree/main.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'src/modules/m_spanningtree/main.cpp') diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index cc5f27ccc..f186d3d02 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -325,16 +325,19 @@ ModResult ModuleSpanningTree::HandleVersion(const CommandBase::Params& parameter return MOD_RES_PASSTHRU; } - // If an oper wants to see the version then show the full version string instead of the normal, - // but only if it is non-empty. - // 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())); - Numeric::Numeric numeric(RPL_VERSION); - irc::tokenstream tokens(showfull ? found->GetFullVersion() : found->GetVersion()); - for (std::string token; tokens.GetTrailing(token); ) - numeric.push(token); + if (user->IsOper()) + { + numeric.push(found->rawversion + "."); + numeric.push(found->GetName()); + numeric.push("[" + found->GetId() + "] " + found->customversion); + } + else + { + numeric.push(found->rawbranch + "."); + numeric.push(found->GetPublicName()); + numeric.push(found->customversion); + } user->WriteNumeric(numeric); } else -- cgit v1.3.1-10-gc9f91