From 18c918cc88b9f6fc85734392c33776bbb4f22dac Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Tue, 17 Jun 2014 13:32:00 +0200 Subject: [PATCH] m_spanningtree Show the full version string of servers to opers Issue #637, suggested by @CuleX --- src/modules/m_spanningtree/main.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index 59937cc6a..21eaaa00d 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -359,7 +359,13 @@ ModResult ModuleSpanningTree::HandleVersion(const std::vector& para // Pass to default VERSION handler. return MOD_RES_PASSTHRU; } - std::string Version = found->GetVersion(); + + // 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())); + const std::string& Version = (showfull ? found->GetFullVersion() : found->GetVersion()); user->WriteNumeric(RPL_VERSION, ":%s", Version.c_str()); } else -- 2.39.5