summaryrefslogtreecommitdiff
path: root/src/modules/m_nationalchars.cpp
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-26 14:13:13 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-26 14:13:13 +0000
commit6d03943426dcce76ba66567a9b18425a5ebb4c0c (patch)
treebedffa6d2a65a9ef556405224a6d7a181c8a1ba5 /src/modules/m_nationalchars.cpp
parent810c662c9b55908101ca085293c52c3239ef22d1 (diff)
Remove InspIRCd* parameters and fields
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11763 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_nationalchars.cpp')
-rwxr-xr-xsrc/modules/m_nationalchars.cpp25
1 files changed, 7 insertions, 18 deletions
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<bool, const char*, size_t>
{
- 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<bool, const char*, size_t> * rememberer;
+ caller2<bool, const char*, size_t> rememberer;
bool forcequit;
const unsigned char * lowermap_rememberer;
public:
- ModuleNationalChars(InspIRCd* Me) : Module(Me)
+ ModuleNationalChars() : rememberer(ServerInstance->IsNick)
{
- rememberer = (caller2<bool, const char*, size_t> *) malloc(sizeof(caller2<bool, const char*, size_t>));
-
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");
}