From 696fd30209f25d748193c7581a29837a1f8db053 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 26 Jun 2022 17:17:41 +0100 Subject: Move config xline reading and rehashing to core_xline. --- src/configreader.cpp | 32 -------------------------------- 1 file changed, 32 deletions(-) (limited to 'src/configreader.cpp') diff --git a/src/configreader.cpp b/src/configreader.cpp index 4faaa2ab7..176a1d6c6 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -41,7 +41,6 @@ #include "inspircd.h" #include "configparser.h" #include "exitcodes.h" -#include "xline.h" ServerLimits::ServerLimits(std::shared_ptr tag) : MaxLine(tag->getUInt("maxline", 512, 512)) @@ -92,30 +91,6 @@ ServerConfig::ServerConfig() { } -static void ReadXLine(ServerConfig* conf, const std::string& tag, const std::string& key, XLineFactory* make) -{ - insp::flat_set configlines; - - for (const auto& [_, ctag] : conf->ConfTags(tag)) - { - const std::string mask = ctag->getString(key); - if (mask.empty()) - throw CoreException("<" + tag + ":" + key + "> missing at " + ctag->source.str()); - - const std::string reason = ctag->getString("reason"); - if (reason.empty()) - throw CoreException("<" + tag + ":reason> missing at " + ctag->source.str()); - - XLine* xl = make->Generate(ServerInstance->Time(), 0, ServerInstance->Config->ServerName, reason, mask); - xl->from_config = true; - configlines.insert(xl->Displayable()); - if (!ServerInstance->XLines->AddLine(xl, NULL)) - delete xl; - } - - ServerInstance->XLines->ExpireRemovedConfigLines(make->GetType(), configlines); -} - typedef std::map> LocalIndex; void ServerConfig::CrossCheckOperClassType() { @@ -363,11 +338,6 @@ void ServerConfig::Fill() SocketEngine::Close(socktest); } - ReadXLine(this, "badip", "ipmask", ServerInstance->XLines->GetFactory("Z")); - ReadXLine(this, "badnick", "nick", ServerInstance->XLines->GetFactory("Q")); - ReadXLine(this, "badhost", "host", ServerInstance->XLines->GetFactory("K")); - ReadXLine(this, "exception", "host", ServerInstance->XLines->GetFactory("E")); - const std::string restrictbannedusers = options->getString("restrictbannedusers", "yes", 1); if (stdalgo::string::equalsci(restrictbannedusers, "no")) RestrictBannedUsers = ServerConfig::BUT_NORMAL; @@ -649,8 +619,6 @@ void ConfigReaderThread::OnStop() * thoroughly!!! */ ServerInstance->Users.RehashCloneCounts(); - ServerInstance->XLines->CheckELines(); - ServerInstance->XLines->ApplyLines(); User* user = ServerInstance->Users.FindUUID(UUID); ConfigStatus status(user); -- cgit v1.3.1-10-gc9f91