inspircd

A modular C++ IRC daemon (ircd). https://www.inspircd.org/
Log | Files | Refs | README

commit b9e732f73b0cb8e1fde9181a8b5502927feaf339
parent e55277283800bfdfef86485a6b0c7a4e7755a15b
Author: Peter Powell <petpow@saberuk.com>
Date:   Mon, 13 May 2019 19:32:39 +0100

If a parent server is hidden then also hide its child servers.

This should fix #851.

Diffstat:
Msrc/modules/m_spanningtree/server.cpp | 10++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

diff --git 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()); }