mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-10 02:59:01 -04:00
Change Config->CaseMapping back when unloading.
Now that casemapping is configurable in the core and we set that Config variable rather than just modifying the ISupport output each time, we need to change the variable back when being unloaded. So we save the current value when loading and set it back when being unloaded. We also need to call the ISupport builder a second time as the core calls it before we destruct.
This commit is contained in:
parent
43da9c3232
commit
36d7ee44a8
@ -222,6 +222,7 @@ class ModuleNationalChars : public Module
|
||||
TR1NS::function<bool(const std::string&)> rememberer;
|
||||
bool forcequit;
|
||||
const unsigned char * lowermap_rememberer;
|
||||
std::string casemapping_rememberer;
|
||||
unsigned char prev_map[256];
|
||||
|
||||
template <typename T>
|
||||
@ -248,7 +249,9 @@ class ModuleNationalChars : public Module
|
||||
|
||||
public:
|
||||
ModuleNationalChars()
|
||||
: rememberer(ServerInstance->IsNick), lowermap_rememberer(national_case_insensitive_map)
|
||||
: rememberer(ServerInstance->IsNick)
|
||||
, lowermap_rememberer(national_case_insensitive_map)
|
||||
, casemapping_rememberer(ServerInstance->Config->CaseMapping)
|
||||
{
|
||||
memcpy(prev_map, national_case_insensitive_map, sizeof(prev_map));
|
||||
}
|
||||
@ -305,6 +308,9 @@ class ModuleNationalChars : public Module
|
||||
{
|
||||
ServerInstance->IsNick = rememberer;
|
||||
national_case_insensitive_map = lowermap_rememberer;
|
||||
ServerInstance->Config->CaseMapping = casemapping_rememberer;
|
||||
// The core rebuilds ISupport on module unload, but before the dtor.
|
||||
ServerInstance->ISupport.Build();
|
||||
CheckForceQuit("National characters module unloaded");
|
||||
CheckRehash();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user