]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_silence.cpp
Add a Flash Policy Daemon module
[user/henk/code/inspircd.git] / src / modules / m_silence.cpp
index 1169d0d547a3cb8e9ea59c27de778a1b337461d0..1c76b72f75133bf55db1909c7e263e5bd1dbe9bb 100644 (file)
@@ -124,10 +124,10 @@ class CommandSilence : public Command
                                for (silencelist::const_iterator c = sl->begin(); c != sl->end(); c++)
                                {
                                        std::string decomppattern = DecompPattern(c->second);
-                                       user->WriteNumeric(271, "%s %s %s %s",user->nick.c_str(), user->nick.c_str(),c->first.c_str(), decomppattern.c_str());
+                                       user->WriteNumeric(271, "%s %s %s", user->nick.c_str(),c->first.c_str(), decomppattern.c_str());
                                }
                        }
-                       user->WriteNumeric(272, "%s :End of Silence List",user->nick.c_str());
+                       user->WriteNumeric(272, ":End of Silence List");
 
                        return CMD_SUCCESS;
                }
@@ -173,7 +173,7 @@ class CommandSilence : public Command
                                                if (listitem == mask && i->second == pattern)
                                                {
                                                        sl->erase(i);
-                                                       user->WriteNumeric(950, "%s %s :Removed %s %s from silence list",user->nick.c_str(), user->nick.c_str(), mask.c_str(), decomppattern.c_str());
+                                                       user->WriteNumeric(950, "%s :Removed %s %s from silence list", user->nick.c_str(), mask.c_str(), decomppattern.c_str());
                                                        if (!sl->size())
                                                        {
                                                                ext.unset(user);
@@ -182,7 +182,7 @@ class CommandSilence : public Command
                                                }
                                        }
                                }
-                               user->WriteNumeric(952, "%s %s :%s %s does not exist on your silence list",user->nick.c_str(), user->nick.c_str(), mask.c_str(), decomppattern.c_str());
+                               user->WriteNumeric(952, "%s :%s %s does not exist on your silence list", user->nick.c_str(), mask.c_str(), decomppattern.c_str());
                        }
                        else if (action == '+')
                        {
@@ -195,7 +195,7 @@ class CommandSilence : public Command
                                }
                                if (sl->size() > maxsilence)
                                {
-                                       user->WriteNumeric(952, "%s %s :Your silence list is full",user->nick.c_str(), user->nick.c_str());
+                                       user->WriteNumeric(952, "%s :Your silence list is full",user->nick.c_str());
                                        return CMD_FAILURE;
                                }
 
@@ -205,7 +205,7 @@ class CommandSilence : public Command
                                        irc::string listitem = n->first.c_str();
                                        if (listitem == mask && n->second == pattern)
                                        {
-                                               user->WriteNumeric(952, "%s %s :%s %s is already on your silence list",user->nick.c_str(), user->nick.c_str(), mask.c_str(), decomppattern.c_str());
+                                               user->WriteNumeric(952, "%s :%s %s is already on your silence list", user->nick.c_str(), mask.c_str(), decomppattern.c_str());
                                                return CMD_FAILURE;
                                        }
                                }
@@ -217,7 +217,7 @@ class CommandSilence : public Command
                                {
                                        sl->push_back(silenceset(mask,pattern));
                                }
-                               user->WriteNumeric(951, "%s %s :Added %s %s to silence list",user->nick.c_str(), user->nick.c_str(), mask.c_str(), decomppattern.c_str());
+                               user->WriteNumeric(951, "%s :Added %s %s to silence list", user->nick.c_str(), mask.c_str(), decomppattern.c_str());
                                return CMD_SUCCESS;
                        }
                }
@@ -299,18 +299,7 @@ class ModuleSilence : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               OnRehash(NULL);
-               ServerInstance->Modules->AddService(cmdsilence);
-               ServerInstance->Modules->AddService(cmdsvssilence);
-               ServerInstance->Modules->AddService(cmdsilence.ext);
-
-               Implementation eventlist[] = { I_OnRehash, I_On005Numeric, I_OnUserPreMessage, I_OnUserPreInvite };
-               ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
-       }
-
-       void OnRehash(User* user) CXX11_OVERRIDE
+       void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
        {
                maxsilence = ServerInstance->Config->ConfValue("showwhois")->getInt("maxentries", 32);
                if (!maxsilence)