]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/commands/cmd_whowas.cpp
Merge pull request #591 from SaberUK/master+config-tweaks
[user/henk/code/inspircd.git] / src / commands / cmd_whowas.cpp
index a973e44ccc20b9d66b3da00ebeff3a3ecf8292d2..8a1c9a820e7378d797a7f261a7a96eb1f2511f67 100644 (file)
@@ -317,8 +317,6 @@ class ModuleWhoWas : public Module
        void init()
        {
                ServerInstance->Modules->AddService(cmd);
-               Implementation eventlist[] = { I_OnGarbageCollect, I_OnUserQuit, I_OnStats, I_OnRehash };
-               ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
                OnRehash(NULL);
        }
 
@@ -344,12 +342,10 @@ class ModuleWhoWas : public Module
        void OnRehash(User* user)
        {
                ConfigTag* tag = ServerInstance->Config->ConfValue("whowas");
-               int NewGroupSize = tag->getInt("groupsize");
-               int NewMaxGroups = tag->getInt("maxgroups");
+               int NewGroupSize = tag->getInt("groupsize", 10, 0, 10000);
+               int NewMaxGroups = tag->getInt("maxgroups", 10240, 0, 1000000);
                int NewMaxKeep = InspIRCd::Duration(tag->getString("maxkeep"));
 
-               RangeCheck(NewGroupSize, 0, 10000, 10, "<whowas:groupsize>");
-               RangeCheck(NewMaxGroups, 0, 1000000, 10240, "<whowas:maxgroups>");
                RangeCheck(NewMaxKeep, 3600, INT_MAX, 3600, "<whowas:maxkeep>");
 
                if ((NewGroupSize == cmd.WhoWasGroupSize) && (NewMaxGroups == cmd.WhoWasMaxGroups) && (NewMaxKeep == cmd.WhoWasMaxKeep))