diff options
author | Attila Molnar <attilamolnar@hush.com> | 2014-01-08 12:41:01 +0100 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2014-01-08 12:41:01 +0100 |
commit | d379dcab405bd4b0542e3c645a2de3c1a27832b8 (patch) | |
tree | b67b9882cf5ea9df81599732362f71106edc17c6 /src/modules | |
parent | ade1500382366b0cf24147370aea0a3e5bbe50bf (diff) |
Read uline state in spanningtree; remove ConfigReader::ulines
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; + } } } |