]> 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 2779f29ba502e531029198eda0417d01e558d0bb..8a1c9a820e7378d797a7f261a7a96eb1f2511f67 100644 (file)
@@ -183,7 +183,7 @@ void CommandWhowas::PruneWhoWas(time_t t)
                        if (iter == whowas.end())
                        {
                                /* this should never happen, if it does maps are corrupt */
-                               ServerInstance->Logs->Log("WHOWAS",LOG_DEFAULT, "BUG: Whowas maps got corrupted! (1)");
+                               ServerInstance->Logs->Log("WHOWAS", LOG_DEFAULT, "BUG: Whowas maps got corrupted! (1)");
                                return;
                        }
 
@@ -216,7 +216,7 @@ void CommandWhowas::PruneWhoWas(time_t t)
                if (iter == whowas.end())
                {
                        /* this should never happen, if it does maps are corrupt */
-                       ServerInstance->Logs->Log("WHOWAS",LOG_DEFAULT, "BUG: Whowas maps got corrupted! (2)");
+                       ServerInstance->Logs->Log("WHOWAS", LOG_DEFAULT, "BUG: Whowas maps got corrupted! (2)");
                        return;
                }
                whowas_set* n = (whowas_set*)iter->second;
@@ -264,7 +264,7 @@ CommandWhowas::~CommandWhowas()
                if (iter == whowas.end())
                {
                        /* this should never happen, if it does maps are corrupt */
-                       ServerInstance->Logs->Log("WHOWAS",LOG_DEFAULT, "BUG: Whowas maps got corrupted! (3)");
+                       ServerInstance->Logs->Log("WHOWAS", LOG_DEFAULT, "BUG: Whowas maps got corrupted! (3)");
                        return;
                }
 
@@ -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))