diff options
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_spanningtree/override_stats.cpp | 11 | ||||
-rw-r--r-- | src/modules/m_spanningtree/treeserver.cpp | 21 |
2 files changed, 28 insertions, 4 deletions
diff --git a/src/modules/m_spanningtree/override_stats.cpp b/src/modules/m_spanningtree/override_stats.cpp index 9762ecf4e..bdfc6ef43 100644 --- a/src/modules/m_spanningtree/override_stats.cpp +++ b/src/modules/m_spanningtree/override_stats.cpp @@ -37,6 +37,17 @@ ModResult ModuleSpanningTree::OnStats(char statschar, User* user, string_list &r } return MOD_RES_DENY; } + else if (statschar == 'U') + { + ConfigTagList tags = ServerInstance->Config->ConfTags("uline"); + for (ConfigIter i = tags.first; i != tags.second; ++i) + { + std::string name = i->second->getString("server"); + if (!name.empty()) + results.push_back(ServerInstance->Config->ServerName+" 248 "+user->nick+" U "+name); + } + return MOD_RES_DENY; + } return MOD_RES_PASSTHRU; } diff --git a/src/modules/m_spanningtree/treeserver.cpp b/src/modules/m_spanningtree/treeserver.cpp index ecde17261..b51c21db6 100644 --- a/src/modules/m_spanningtree/treeserver.cpp +++ b/src/modules/m_spanningtree/treeserver.cpp @@ -160,11 +160,24 @@ int TreeServer::QuitUsers(const std::string &reason) void TreeServer::CheckULine() { uline = silentuline = false; - std::map<irc::string, bool>::iterator it = ServerInstance->Config->ulines.find(GetName().c_str()); - if (it != ServerInstance->Config->ulines.end()) + + ConfigTagList tags = ServerInstance->Config->ConfTags("uline"); + for (ConfigIter i = tags.first; i != tags.second; ++i) { - uline = true; - silentuline = it->second; + ConfigTag* tag = i->second; + std::string server = tag->getString("server"); + if (!strcasecmp(server.c_str(), GetName().c_str())) + { + if (this->IsRoot()) + { + ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "Servers should not uline themselves (at " + tag->getTagLocation() + ")"); + return; + } + + uline = true; + silentuline = tag->getBool("silent"); + break; + } } } |