From 6d03943426dcce76ba66567a9b18425a5ebb4c0c Mon Sep 17 00:00:00 2001 From: danieldg Date: Sat, 26 Sep 2009 14:13:13 +0000 Subject: Remove InspIRCd* parameters and fields git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11763 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_nationalchars.cpp | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) (limited to 'src/modules/m_nationalchars.cpp') diff --git a/src/modules/m_nationalchars.cpp b/src/modules/m_nationalchars.cpp index 2fe8dcf39..04b53f02c 100755 --- a/src/modules/m_nationalchars.cpp +++ b/src/modules/m_nationalchars.cpp @@ -24,9 +24,8 @@ class lwbNickHandler : public HandlerBase2 { - InspIRCd* Server; public: - lwbNickHandler(InspIRCd* Srv) : Server(Srv) { } + lwbNickHandler() { } virtual ~lwbNickHandler() { } virtual bool Call(const char*, size_t); }; @@ -214,29 +213,21 @@ bool lwbNickHandler::Call(const char* n, size_t max) class ModuleNationalChars : public Module { private: - - InspIRCd* ServerInstance; - lwbNickHandler* myhandler; + lwbNickHandler myhandler; std::string charset, casemapping; unsigned char m_additional[256], m_additionalUp[256], m_lower[256], m_upper[256]; - caller2 * rememberer; + caller2 rememberer; bool forcequit; const unsigned char * lowermap_rememberer; public: - ModuleNationalChars(InspIRCd* Me) : Module(Me) + ModuleNationalChars() : rememberer(ServerInstance->IsNick) { - rememberer = (caller2 *) malloc(sizeof(caller2)); - lowermap_rememberer = national_case_insensitive_map; memcpy(m_lower, rfc_case_insensitive_map, 256); national_case_insensitive_map = m_lower; - ServerInstance = Me; - - *rememberer = ServerInstance->IsNick; - myhandler = new lwbNickHandler(ServerInstance); - ServerInstance->IsNick = myhandler; + ServerInstance->IsNick = &myhandler; Implementation eventlist[] = { I_OnRehash, I_On005Numeric }; ServerInstance->Modules->Attach(eventlist, this, 2); @@ -252,7 +243,7 @@ class ModuleNationalChars : public Module virtual void OnRehash(User* user) { - ConfigReader* conf = new ConfigReader(ServerInstance); + ConfigReader* conf = new ConfigReader; charset = conf->ReadValue("nationalchars", "file", 0); casemapping = conf->ReadValue("nationalchars", "casemapping", charset, 0, false); charset.insert(0, "../locales/"); @@ -279,9 +270,7 @@ class ModuleNationalChars : public Module virtual ~ModuleNationalChars() { - delete myhandler; - ServerInstance->IsNick = *rememberer; - free(rememberer); + ServerInstance->IsNick = rememberer; national_case_insensitive_map = lowermap_rememberer; CheckForceQuit("National characters module unloaded"); } -- cgit v1.2.3