]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_sethost.cpp
Attach to events and register services in init()
[user/henk/code/inspircd.git] / src / modules / m_sethost.cpp
index ae0cc7c5641eb301ff199b987f0ae884b54ddc29..e4662791dc18a3febb4d7b0ccfb3911a5e21607b 100644 (file)
@@ -76,6 +76,10 @@ class ModuleSetHost : public Module
  public:
        ModuleSetHost()
                : cmd(this, hostmap)
+       {
+       }
+
+       void init()
        {
                OnRehash(NULL);
                ServerInstance->AddCommand(&cmd);
@@ -83,14 +87,9 @@ class ModuleSetHost : public Module
                ServerInstance->Modules->Attach(eventlist, this, 1);
        }
 
-
        void OnRehash(User* user)
        {
-               ConfigReader Conf;
-               std::string hmap = Conf.ReadValue("hostname", "charmap", 0);
-
-               if (hmap.empty())
-                       hmap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.-_/0123456789";
+               std::string hmap = ServerInstance->Config->ConfValue("hostname")->getString("charmap", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.-_/0123456789");
 
                memset(hostmap, 0, sizeof(hostmap));
                for (std::string::iterator n = hmap.begin(); n != hmap.end(); n++)