summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-02-03 10:22:40 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-02-03 10:22:40 +0000
commitb6b12769298bfc1d1c9a28457c84f7993dafb046 (patch)
tree841d55194e88a7b005d06acf221fdbfb919e3fd3
parent7cbc465e2a153f65c242aebc1b2a88d3c667d551 (diff)
Added <options:flatlinks>
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3035 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--docs/inspircd.conf.example5
-rw-r--r--src/modules/m_spanningtree.cpp8
2 files changed, 11 insertions, 2 deletions
diff --git a/docs/inspircd.conf.example b/docs/inspircd.conf.example
index 11fdc6da4..3eaf44224 100644
--- a/docs/inspircd.conf.example
+++ b/docs/inspircd.conf.example
@@ -530,6 +530,10 @@
# something like '*.netname.net' to conceal the #
# actual server the user is on. #
# #
+# flatlinks - When you are using m_spanningtree.so, and this #
+# value is set to true, yes or 1, /MAP and /LINKS #
+# will be flattened when shown to a non-oper. #
+# #
<options prefixquit="Quit: "
loglevel="default"
@@ -543,6 +547,7 @@
maxtargets="20"
hidesplits="no"
hidewhois=""
+ flatlinks="no"
allowhalfop="yes">
diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp
index bd1b22f50..413950e5c 100644
--- a/src/modules/m_spanningtree.cpp
+++ b/src/modules/m_spanningtree.cpp
@@ -124,6 +124,9 @@ bool DoOneToMany(std::string prefix, std::string command, std::deque<std::string
bool DoOneToAllButSenderRaw(std::string data, std::string omit, std::string prefix, std::string command, std::deque<std::string> &params);
void ReadConfiguration(bool rebind);
+/* Flatten links and /MAP for non-opers */
+bool FlatLinks;
+
/* Imported from xline.cpp for use during netburst */
extern std::vector<KLine> klines;
extern std::vector<GLine> glines;
@@ -2418,6 +2421,7 @@ void ReadConfiguration(bool rebind)
}
}
}
+ FlatLinks = Conf->ReadFlag("options","flatlinks",0);
LinkBlocks.clear();
for (int j =0; j < Conf->Enumerate("link"); j++)
{
@@ -2492,7 +2496,7 @@ class ModuleSpanningTree : public Module
{
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(),hops,Current->GetDesc().c_str());
+ WriteServ(user->fd,"364 %s %s %s :%d %s",user->nick,Current->GetName().c_str(),Parent.c_str(),(FlatLinks && (!*user->oper)) ? 1 : hops,Current->GetDesc().c_str());
}
int CountLocalServs()
@@ -2561,7 +2565,7 @@ class ModuleSpanningTree : public Module
line++;
for (unsigned int q = 0; q < Current->ChildCount(); q++)
{
- ShowMap(Current->GetChild(q),user,depth+2,matrix);
+ ShowMap(Current->GetChild(q),user,(FlatLinks && (!*user->oper)) ? depth : depth+2,matrix);
}
}
}