]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_silence.cpp
Add m_clearchan which removes users from a channel without sending n*(n+1)/2 QUIT...
[user/henk/code/inspircd.git] / src / modules / m_silence.cpp
index 1c76b72f75133bf55db1909c7e263e5bd1dbe9bb..3a213c6e7c2e0b2c43d8526a75f3137d04736767 100644 (file)
@@ -76,7 +76,7 @@ class CommandSVSSilence : public Command
                 * style command so services can modify lots of entries at once.
                 * leaving it backwards compatible for now as it's late. -- w
                 */
-               if (!ServerInstance->ULine(user->server))
+               if (!user->server->IsULine())
                        return CMD_FAILURE;
 
                User *u = ServerInstance->FindNick(parameters[0]);
@@ -85,7 +85,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;
@@ -301,7 +301,7 @@ class ModuleSilence : public Module
 
        void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
        {
-               maxsilence = ServerInstance->Config->ConfValue("showwhois")->getInt("maxentries", 32);
+               maxsilence = ServerInstance->Config->ConfValue("silence")->getInt("maxentries", 32);
                if (!maxsilence)
                        maxsilence = 32;
        }
@@ -338,10 +338,7 @@ class ModuleSilence : public Module
                else if (target_type == TYPE_CHANNEL)
                {
                        Channel* chan = (Channel*)dest;
-                       if (chan)
-                       {
-                               this->OnBuildExemptList(msgtype, chan, user, status, exempt_list, "");
-                       }
+                       this->OnBuildExemptList(msgtype, chan, user, status, exempt_list, "");
                }
                return MOD_RES_PASSTHRU;
        }
@@ -353,10 +350,6 @@ class ModuleSilence : public Module
 
        ModResult MatchPattern(User* dest, User* source, int pattern)
        {
-               /* Server source */
-               if (!source || !dest)
-                       return MOD_RES_ALLOW;
-
                silencelist* sl = cmdsilence.ext.get(dest);
                if (sl)
                {