]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_nationalchars.cpp
m_spanningtree Replace manual string building of outgoing commands with CmdBuilder...
[user/henk/code/inspircd.git] / src / modules / m_nationalchars.cpp
index a668b7a2c9e1ebe4ff9db6ba60d38bed66e0c5b1..6889e388f30670b5c36e09e9420895aa17544ba6 100644 (file)
    by Chernov-Phoenix Alexey (Phoenix@RusNet) mailto:phoenix /email address separator/ pravmail.ru */
 
 #include "inspircd.h"
-#include "caller.h"
 #include <fstream>
 
-/* $ModDesc: Provides an ability to have non-RFC1459 nicks & support for national CASEMAPPING */
-
 class lwbNickHandler : public HandlerBase1<bool, const std::string&>
 {
  public:
-       lwbNickHandler() { }
-       ~lwbNickHandler() { }
        bool Call(const std::string&);
 };
 
@@ -241,10 +236,6 @@ class ModuleNationalChars : public Module
                national_case_insensitive_map = m_lower;
 
                ServerInstance->IsNick = &myhandler;
-
-               Implementation eventlist[] = { I_OnRehash, I_On005Numeric };
-               ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
-               OnRehash(NULL);
        }
 
        void On005Numeric(std::map<std::string, std::string>& tokens) CXX11_OVERRIDE
@@ -252,7 +243,7 @@ class ModuleNationalChars : public Module
                tokens["CASEMAPPING"] = casemapping;
        }
 
-       void OnRehash(User* user) CXX11_OVERRIDE
+       void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
        {
                ConfigTag* tag = ServerInstance->Config->ConfValue("nationalchars");
                charset = tag->getString("file");
@@ -302,10 +293,10 @@ class ModuleNationalChars : public Module
        /*so Bynets Unreal distribution stuff*/
        void loadtables(std::string filename, unsigned char ** tables, unsigned char cnt, char faillimit)
        {
-               std::ifstream ifs(filename.c_str());
+               std::ifstream ifs(ServerInstance->Config->Paths.PrependConfig(filename).c_str());
                if (ifs.fail())
                {
-                       ServerInstance->Logs->Log("m_nationalchars", LOG_DEFAULT, "loadtables() called for missing file: %s", filename.c_str());
+                       ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "loadtables() called for missing file: %s", filename.c_str());
                        return;
                }
 
@@ -320,7 +311,7 @@ class ModuleNationalChars : public Module
                {
                        if (loadtable(ifs, tables[n], 255) && (n < faillimit))
                        {
-                               ServerInstance->Logs->Log("m_nationalchars", LOG_DEFAULT, "loadtables() called for illegal file: %s (line %d)", filename.c_str(), n+1);
+                               ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "loadtables() called for illegal file: %s (line %d)", filename.c_str(), n+1);
                                return;
                        }
                }