summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_nationalchars.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/modules/m_nationalchars.cpp b/src/modules/m_nationalchars.cpp
index b43b6e2b6..20e4eaa9e 100644
--- a/src/modules/m_nationalchars.cpp
+++ b/src/modules/m_nationalchars.cpp
@@ -228,11 +228,24 @@ class ModuleNationalChars : public Module
caller2<bool, const char*, size_t> rememberer;
bool forcequit;
const unsigned char * lowermap_rememberer;
+ unsigned char prev_map[256];
+
+ void CheckRehash()
+ {
+ // See if anything changed
+ if (!memcmp(prev_map, national_case_insensitive_map, sizeof(prev_map)))
+ return;
+
+ memcpy(prev_map, national_case_insensitive_map, sizeof(prev_map));
+
+ ServerInstance->RehashUsersAndChans();
+ }
public:
ModuleNationalChars()
: rememberer(ServerInstance->IsNick), lowermap_rememberer(national_case_insensitive_map)
{
+ memcpy(prev_map, national_case_insensitive_map, sizeof(prev_map));
}
void init()
@@ -265,6 +278,7 @@ class ModuleNationalChars : public Module
loadtables(charset, tables, 8, 5);
forcequit = tag->getBool("forcequit");
CheckForceQuit("National character set changed");
+ CheckRehash();
}
void CheckForceQuit(const char * message)
@@ -286,6 +300,7 @@ class ModuleNationalChars : public Module
ServerInstance->IsNick = rememberer;
national_case_insensitive_map = lowermap_rememberer;
CheckForceQuit("National characters module unloaded");
+ CheckRehash();
}
virtual Version GetVersion()