]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_silence.cpp
Fix various warnings when building with LLVM 3.5.
[user/henk/code/inspircd.git] / src / modules / m_silence.cpp
index 40a42c9d7e6d67b6dcde16611c0b66a181920f51..c82ab3f9d6052ecf7c21f571bdfee029291b119a 100644 (file)
@@ -87,7 +87,7 @@ class CommandSVSSilence : public Command
 
                if (IS_LOCAL(u))
                {
-                       ServerInstance->Parser->CallHandler("SILENCE", std::vector<std::string>(++parameters.begin(), parameters.end()), u);
+                       ServerInstance->Parser->CallHandler("SILENCE", std::vector<std::string>(parameters.begin() + 1, parameters.end()), u);
                }
 
                return CMD_SUCCESS;
@@ -110,6 +110,7 @@ class CommandSilence : public Command
        CommandSilence(Module* Creator, unsigned int &max) : Command(Creator, "SILENCE", 0),
                maxsilence(max), ext("silence_list", Creator)
        {
+               allow_empty_last_param = false;
                syntax = "{[+|-]<mask> <p|c|i|n|t|a|x>}";
                TRANSLATE3(TR_TEXT, TR_TEXT, TR_END);
        }
@@ -304,17 +305,17 @@ class ModuleSilence : public Module
        void init()
        {
                OnRehash(NULL);
-               ServerInstance->AddCommand(&cmdsilence);
-               ServerInstance->AddCommand(&cmdsvssilence);
-               ServerInstance->Extensions.Register(&cmdsilence.ext);
+               ServerInstance->Modules->AddService(cmdsilence);
+               ServerInstance->Modules->AddService(cmdsvssilence);
+               ServerInstance->Modules->AddService(cmdsilence.ext);
 
                Implementation eventlist[] = { I_OnRehash, I_On005Numeric, I_OnUserPreNotice, I_OnUserPreMessage, I_OnUserPreInvite };
-               ServerInstance->Modules->Attach(eventlist, this, 5);
+               ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
        }
 
        void OnRehash(User* user)
        {
-               maxsilence = ServerInstance->Config->ConfValue("showwhois")->getInt("maxentries", 32);
+               maxsilence = ServerInstance->Config->ConfValue("silence")->getInt("maxentries", 32);
                if (!maxsilence)
                        maxsilence = 32;
        }