summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-02-03 10:58:44 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-02-03 10:58:44 +0000
commitbb4e045b7c4d5a98ddae1f3ffec4439615c74fa1 (patch)
tree1508c4dc93f438b50afff0e594e33eff7a9455a3 /src/modules
parent73f4144cfd459ef1e52c482a6714935c9b0e0a16 (diff)
Added <options:hideulines>
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3037 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_spanningtree.cpp27
1 files changed, 25 insertions, 2 deletions
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<KLine> 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);
+ }
}
}
}