From bb4e045b7c4d5a98ddae1f3ffec4439615c74fa1 Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 3 Feb 2006 10:58:44 +0000 Subject: Added git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3037 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree.cpp | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index d0de86f7a..2be8e16b1 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -126,6 +126,8 @@ void ReadConfiguration(bool rebind); /* Flatten links and /MAP for non-opers */ bool FlatLinks; +/* Hide U-Lined servers in /MAP and /LINKS */ +bool HideULines; /* Imported from xline.cpp for use during netburst */ extern std::vector klines; @@ -2422,6 +2424,7 @@ void ReadConfiguration(bool rebind) } } FlatLinks = Conf->ReadFlag("options","flatlinks",0); + HideULines = Conf->ReadFlag("options","hideulines",0); LinkBlocks.clear(); for (int j =0; j < Conf->Enumerate("link"); j++) { @@ -2494,7 +2497,17 @@ class ModuleSpanningTree : public Module } for (unsigned int q = 0; q < Current->ChildCount(); q++) { - ShowLinks(Current->GetChild(q),user,hops+1); + if ((HideULines) && (Srv->IsUlined(Current->GetName()))) + { + if (*user->oper) + { + ShowLinks(Current->GetChild(q),user,hops+1); + } + } + else + { + ShowLinks(Current->GetChild(q),user,hops+1); + } } WriteServ(user->fd,"364 %s %s %s :%d %s",user->nick,Current->GetName().c_str(),Parent.c_str(),(FlatLinks && (!*user->oper)) ? 0 : hops,Current->GetDesc().c_str()); } @@ -2565,7 +2578,17 @@ class ModuleSpanningTree : public Module line++; for (unsigned int q = 0; q < Current->ChildCount(); q++) { - ShowMap(Current->GetChild(q),user,(FlatLinks && (!*user->oper)) ? depth : depth+2,matrix); + if ((HideULines) && (Srv->IsUlined(Current->GetChild(q)->GetName()))) + { + if (*user->oper) + { + ShowMap(Current->GetChild(q),user,(FlatLinks && (!*user->oper)) ? depth : depth+2,matrix); + } + } + else + { + ShowMap(Current->GetChild(q),user,(FlatLinks && (!*user->oper)) ? depth : depth+2,matrix); + } } } } -- cgit v1.2.3