diff options
Diffstat (limited to 'src/configreader.cpp')
-rw-r--r-- | src/configreader.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp index 04918e7cf..b5ea8a815 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -200,6 +200,28 @@ bool ValidateDnsTimeout(const char* tag, const char* value, void* data) return true; } +bool InitializeDisabledCommands(const char* data, InspIRCd* ServerInstance) +{ + std::stringstream dcmds(data); + std::string thiscmd; + + /* Enable everything first */ + for (nspace::hash_map<std::string,command_t*>::iterator x = ServerInstance->Parser->cmdlist.begin(); x != ServerInstance->Parser->cmdlist.end(); x++) + x->second->Disable(false); + + /* Now disable all the ones which the user wants disabled */ + while (dcmds >> thiscmd) + { + nspace::hash_map<std::string,command_t*>::iterator cm = ServerInstance->Parser->cmdlist.find(thiscmd); + if (cm != ServerInstance->Parser->cmdlist.end()) + { + log(DEBUG,"Disabling command '%s'",cm->second->command.c_str()); + cm->second->Disable(true); + } + } + return true; +} + bool ValidateDnsServer(const char* tag, const char* value, void* data) { char* x = (char*)data; |