aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/m_spanningtree/main.cpp
diff options
context:
space:
mode:
authorGravatar brain2007-04-05 22:17:23 +0000
committerGravatar brain2007-04-05 22:17:23 +0000
commit37c77c74a0c18d7c2ea57650d1f518697db75a8a (patch)
treec6c485da9a1d8cd239495ef6a09b8fc2c3b31e9a /src/modules/m_spanningtree/main.cpp
parentAdd extra /map info (connection uptime, and lag time) to /MAP for opers. Adds... (diff)
downloadinspircd++-37c77c74a0c18d7c2ea57650d1f518697db75a8a.tar.gz
inspircd++-37c77c74a0c18d7c2ea57650d1f518697db75a8a.tar.bz2
inspircd++-37c77c74a0c18d7c2ea57650d1f518697db75a8a.zip
Add support for <link:hidden> fixes feature request documented in bug #247 reported by owine
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6738 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree/main.cpp')
-rw-r--r--src/modules/m_spanningtree/main.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp
index 673c2cda1..ed2d73efa 100644
--- a/src/modules/m_spanningtree/main.cpp
+++ b/src/modules/m_spanningtree/main.cpp
@@ -61,7 +61,7 @@ void ModuleSpanningTree::ShowLinks(TreeServer* Current, userrec* user, int hops)
}
for (unsigned int q = 0; q < Current->ChildCount(); q++)
{
- if ((Utils->HideULines) && (ServerInstance->ULine(Current->GetChild(q)->GetName().c_str())))
+ if ((Current->GetChild(q)->Hidden) || ((Utils->HideULines) && (ServerInstance->ULine(Current->GetChild(q)->GetName().c_str()))))
{
if (*user->oper)
{
@@ -74,9 +74,16 @@ void ModuleSpanningTree::ShowLinks(TreeServer* Current, userrec* user, int hops)
}
}
/* Don't display the line if its a uline, hide ulines is on, and the user isnt an oper */
- if ((Utils->HideULines) && (ServerInstance->ULine(Current->GetName().c_str())) && (!*user->oper))
+ if ((Utils->HideULines) && (ServerInstance->ULine(Current->GetName().c_str())) && (!IS_OPER(user)))
return;
- user->WriteServ("364 %s %s %s :%d %s",user->nick,Current->GetName().c_str(),(Utils->FlatLinks && (!*user->oper)) ? ServerInstance->Config->ServerName : Parent.c_str(),(Utils->FlatLinks && (!*user->oper)) ? 0 : hops,Current->GetDesc().c_str());
+ /* Or if the server is hidden and they're not an oper */
+ else if ((Current->Hidden) && (!IS_OPER(user)))
+ return;
+
+ user->WriteServ("364 %s %s %s :%d %s", user->nick,Current->GetName().c_str(),
+ (Utils->FlatLinks && (!IS_OPER(user))) ? ServerInstance->Config->ServerName : Parent.c_str(),
+ (Utils->FlatLinks && (!IS_OPER(user))) ? 0 : hops,
+ Current->GetDesc().c_str());
}
int ModuleSpanningTree::CountLocalServs()
@@ -190,7 +197,7 @@ void ModuleSpanningTree::ShowMap(TreeServer* Current, userrec* user, int depth,
line++;
for (unsigned int q = 0; q < Current->ChildCount(); q++)
{
- if ((Utils->HideULines) && (ServerInstance->ULine(Current->GetChild(q)->GetName().c_str())))
+ if ((Current->GetChild(q)->Hidden) || ((Utils->HideULines) && (ServerInstance->ULine(Current->GetChild(q)->GetName().c_str()))))
{
if (*user->oper)
{