]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_chghost.cpp
Register a few extensions that weren't registered
[user/henk/code/inspircd.git] / src / modules / m_chghost.cpp
index 6991814f6f034e746d05ce1d32eb2cbcfe357df1..4d39127e7923b2aa4d159acf3dc92f2ee9f1a50e 100644 (file)
@@ -92,21 +92,20 @@ class ModuleChgHost : public Module
        char hostmap[256];
  public:
        ModuleChgHost() : cmd(this, hostmap)
+       {
+       }
+
+       void init()
        {
                OnRehash(NULL);
-               ServerInstance->AddCommand(&cmd);
+               ServerInstance->Modules->AddService(cmd);
                Implementation eventlist[] = { I_OnRehash };
-               ServerInstance->Modules->Attach(eventlist, this, 1);
+               ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
        }
 
-
        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++)