]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_shun.cpp
core_hostname_lookup: find answer record of the correct type instead of assuming...
[user/henk/code/inspircd.git] / src / modules / m_shun.cpp
index 075b80eb7a47101eebb3860dbc9989cdf83f7512..5388bb4856da5a2b078d3a9a8cce9c72a742956e 100644 (file)
@@ -168,7 +168,7 @@ class ModuleShun : public Module
 {
        CommandShun cmd;
        ShunFactory f;
-       std::set<std::string> ShunEnabledCommands;
+       insp::flat_set<std::string> ShunEnabledCommands;
        bool NotifyOfShun;
        bool affectopers;
 
@@ -191,15 +191,15 @@ class ModuleShun : public Module
        void Prioritize()
        {
                Module* alias = ServerInstance->Modules->Find("m_alias.so");
-               ServerInstance->Modules->SetPriority(this, I_OnPreCommand, PRIORITY_BEFORE, &alias);
+               ServerInstance->Modules->SetPriority(this, I_OnPreCommand, PRIORITY_BEFORE, alias);
        }
 
-       ModResult OnStats(char symbol, User* user, string_list& out) CXX11_OVERRIDE
+       ModResult OnStats(Stats::Context& stats) CXX11_OVERRIDE
        {
-               if (symbol != 'H')
+               if (stats.GetSymbol() != 'H')
                        return MOD_RES_PASSTHRU;
 
-               ServerInstance->XLines->InvokeStats("SHUN", 223, user, out);
+               ServerInstance->XLines->InvokeStats("SHUN", 223, stats);
                return MOD_RES_DENY;
        }
 
@@ -243,9 +243,7 @@ class ModuleShun : public Module
                        return MOD_RES_PASSTHRU;
                }
 
-               std::set<std::string>::iterator i = ShunEnabledCommands.find(command);
-
-               if (i == ShunEnabledCommands.end())
+               if (!ShunEnabledCommands.count(command))
                {
                        if (NotifyOfShun)
                                user->WriteNotice("*** Command " + command + " not processed, as you have been blocked from issuing commands (SHUN)");