diff options
author | Peter Powell <petpow@saberuk.com> | 2019-05-13 19:32:39 +0100 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2019-05-14 00:58:52 +0100 |
commit | b9e732f73b0cb8e1fde9181a8b5502927feaf339 (patch) | |
tree | 6c7d05b349a3732fae8b16e3f0ac72fc4d4eb642 | |
parent | e55277283800bfdfef86485a6b0c7a4e7755a15b (diff) |
If a parent server is hidden then also hide its child servers.
This should fix #851.
-rw-r--r-- | src/modules/m_spanningtree/server.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/modules/m_spanningtree/server.cpp b/src/modules/m_spanningtree/server.cpp index 0af91a0ed..13fd0b466 100644 --- a/src/modules/m_spanningtree/server.cpp +++ b/src/modules/m_spanningtree/server.cpp @@ -59,9 +59,8 @@ CmdResult CommandServer::HandleServer(TreeServer* ParentOfThis, Params& params) return CMD_FAILURE; } - - Link* lnk = Utils->FindLink(servername); - + TreeServer* route = ParentOfThis->GetRoute(); + Link* lnk = Utils->FindLink(route->GetName()); TreeServer* Node = new TreeServer(servername, description, sid, ParentOfThis, ParentOfThis->GetSocket(), lnk ? lnk->Hidden : false); HandleExtra(Node, params); @@ -85,8 +84,10 @@ void CommandServer::HandleExtra(TreeServer* newserver, Params& params) val.assign(prop, p+1, std::string::npos); } - if (key == "burst") + if (irc::equals(key, "burst")) newserver->BeginBurst(ConvToNum<uint64_t>(val)); + else if (irc::equals(key, "hidden")) + newserver->Hidden = ConvToNum<bool>(val); } } @@ -230,5 +231,6 @@ CommandServer::Builder::Builder(TreeServer* server) push(server->GetID()); if (server->IsBursting()) push_property("burst", ConvToStr(server->StartBurst)); + push_property("hidden", ConvToStr(server->Hidden)); push_last(server->GetDesc()); } |