summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-06-17 13:32:00 +0200
committerAttila Molnar <attilamolnar@hush.com>2014-06-17 13:32:00 +0200
commit18c918cc88b9f6fc85734392c33776bbb4f22dac (patch)
tree2f99101687fc5bbf3384022656cdb85ba03f4459 /src/modules/m_spanningtree
parenteb5e3b356cdfa5a68c28b8f641addaad47c12320 (diff)
m_spanningtree Show the full version string of servers to opers
Issue #637, suggested by @CuleX
Diffstat (limited to 'src/modules/m_spanningtree')
-rw-r--r--src/modules/m_spanningtree/main.cpp8
1 files changed, 7 insertions, 1 deletions
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<std::string>& 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