]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/configreader.cpp
Move whowas settings into cmd_whowas from ConfigReader
[user/henk/code/inspircd.git] / src / configreader.cpp
index 7d204bfb7bda0c9839ae26c4f1ab32b62a029ce8..f7475d54a653b1cdb933c522ed15420956a90804 100644 (file)
@@ -26,7 +26,6 @@
 #include <fstream>
 #include "xline.h"
 #include "exitcodes.h"
-#include "commands/cmd_whowas.h"
 #include "configparser.h"
 #include <iostream>
 #ifdef _WIN32
@@ -36,7 +35,6 @@
 
 ServerConfig::ServerConfig()
 {
-       WhoWasGroupSize = WhoWasMaxGroups = WhoWasMaxKeep = 0;
        RawLog = NoUserDns = HideBans = HideSplits = UndernetMsgPrefix = false;
        WildcardIPv6 = CycleHosts = InvBypassModes = true;
        dns_timeout = 5;
@@ -241,7 +239,7 @@ void ServerConfig::CrossCheckOperClassType()
                std::string name = tag->getString("name");
                if (name.empty())
                        throw CoreException("<type:name> is missing from tag at " + tag->getTagLocation());
-               if (!ServerInstance->IsNick(name.c_str(), Limits.NickMax))
+               if (!ServerInstance->IsNick(name, Limits.NickMax))
                        throw CoreException("<type:name> is invalid (value '" + name + "')");
                if (oper_blocks.find(" " + name) != oper_blocks.end())
                        throw CoreException("Duplicate type block with name " + name + " at " + tag->getTagLocation());
@@ -483,7 +481,7 @@ void ServerConfig::Fill()
                ServerName = ConfValue("server")->getString("name");
                sid = ConfValue("server")->getString("id");
                ValidHost(ServerName, "<server:name>");
-               if (!sid.empty() && !ServerInstance->IsSID(sid))
+               if (!sid.empty() && !InspIRCd::IsSID(sid))
                        throw CoreException(sid + " is not a valid server ID. A server ID must be 3 characters long, with the first character a digit and the next two characters a digit or letter.");
        }
        else
@@ -533,9 +531,6 @@ void ServerConfig::Fill()
        MaxTargets = security->getInt("maxtargets", 20);
        DefaultModes = options->getString("defaultmodes", "nt");
        PID = ConfValue("pid")->getString("file");
-       WhoWasGroupSize = ConfValue("whowas")->getInt("groupsize");
-       WhoWasMaxGroups = ConfValue("whowas")->getInt("maxgroups");
-       WhoWasMaxKeep = ServerInstance->Duration(ConfValue("whowas")->getString("maxkeep"));
        MaxChans = ConfValue("channels")->getInt("users", 20);
        OperMaxChans = ConfValue("channels")->getInt("opers", 60);
        c_ipv4_range = ConfValue("cidr")->getInt("ipv4clone", 32);
@@ -551,15 +546,11 @@ void ServerConfig::Fill()
        Limits.MaxAway = ConfValue("limits")->getInt("maxaway", 200);
        InvBypassModes = options->getBool("invitebypassmodes", true);
        NoSnoticeStack = options->getBool("nosnoticestack", false);
-       WelcomeNotice = options->getBool("welcomenotice", true);
 
        range(SoftLimit, 10, ServerInstance->SE->GetMaxFds(), ServerInstance->SE->GetMaxFds(), "<performance:softlimit>");
        range(MaxConn, 0, SOMAXCONN, SOMAXCONN, "<performance:somaxconn>");
        range(MaxTargets, 1, 31, 20, "<security:maxtargets>");
        range(NetBufferSize, 1024, 65534, 10240, "<performance:netbuffersize>");
-       range(WhoWasGroupSize, 0, 10000, 10, "<whowas:groupsize>");
-       range(WhoWasMaxGroups, 0, 1000000, 10240, "<whowas:maxgroups>");
-       range(WhoWasMaxKeep, 3600, INT_MAX, 3600, "<whowas:maxkeep>");
 
        ValidIP(DNSServer, "<dns:server>");
 
@@ -648,8 +639,6 @@ void ServerConfig::Fill()
                OperSpyWhois = SPYWHOIS_SINGLEMSG;
        else
                OperSpyWhois = SPYWHOIS_NONE;
-
-       Limits.Finalise();
 }
 
 // WARNING: it is not safe to use most of the codebase in this function, as it
@@ -808,10 +797,6 @@ void ServerConfig::Apply(ServerConfig* old, const std::string &useruid)
 
 void ServerConfig::ApplyModules(User* user)
 {
-       Module* whowas = ServerInstance->Modules->Find("cmd_whowas.so");
-       if (whowas)
-               WhowasRequest(NULL, whowas, WhowasRequest::WHOWAS_PRUNE).Send();
-
        const std::vector<std::string> v = ServerInstance->Modules->GetAllModuleNames(0);
        std::vector<std::string> added_modules;
        std::set<std::string> removed_modules(v.begin(), v.end());