]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_silence.cpp
Mark +P mode as oper-only now that it no longer requires an explicit permission string
[user/henk/code/inspircd.git] / src / modules / m_silence.cpp
index be1477a16cfeba9df48837f1ffa83c0e197dbae7..8c26051dbabc54df1c41a46a8c04956490610f21 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2010 InspIRCd Development Team
  * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
@@ -56,7 +56,7 @@ class CommandSVSSilence : public Command
        CommandSVSSilence(Module* Creator) : Command(Creator,"SVSSILENCE", 2)
        {
                syntax = "<target> {[+|-]<mask> <p|c|i|n|t|a|x>}";
-               TRANSLATE3(TR_NICK, TR_TEXT, TR_END); /* we watch for a nick. not a UID. */
+               TRANSLATE4(TR_NICK, TR_TEXT, TR_TEXT, TR_END); /* we watch for a nick. not a UID. */
        }
 
        CmdResult Handle (const std::vector<std::string>& parameters, User *user)
@@ -85,7 +85,10 @@ class CommandSVSSilence : public Command
 
        RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters)
        {
-               return ROUTE_BROADCAST;
+               User* target = ServerInstance->FindNick(parameters[0]);
+               if (target)
+                       return ROUTE_OPT_UCAST(target->server);
+               return ROUTE_LOCALONLY;
        }
 };
 
@@ -270,20 +273,20 @@ class ModuleSilence : public Module
        CommandSVSSilence cmdsvssilence;
  public:
 
-       ModuleSilence(InspIRCd* Me)
-               : Module(Me), maxsilence(32), cmdsilence(this, maxsilence), cmdsvssilence(this)
+       ModuleSilence()
+               : maxsilence(32), cmdsilence(this, maxsilence), cmdsvssilence(this)
        {
                OnRehash(NULL);
                ServerInstance->AddCommand(&cmdsilence);
                ServerInstance->AddCommand(&cmdsvssilence);
 
-               Implementation eventlist[] = { I_OnRehash, I_OnBuildExemptList, I_On005Numeric, I_OnUserPreNotice, I_OnUserPreMessage, I_OnUserPreInvite };
-               ServerInstance->Modules->Attach(eventlist, this, 6);
+               Implementation eventlist[] = { I_OnRehash, I_On005Numeric, I_OnUserPreNotice, I_OnUserPreMessage, I_OnUserPreInvite };
+               ServerInstance->Modules->Attach(eventlist, this, 5);
        }
 
        void OnRehash(User* user)
        {
-               ConfigReader Conf(ServerInstance);
+               ConfigReader Conf;
                maxsilence = Conf.ReadInteger("silence", "maxentries", 0, true);
                if (!maxsilence)
                        maxsilence = 32;
@@ -368,7 +371,7 @@ class ModuleSilence : public Module
 
        Version GetVersion()
        {
-               return Version("$Id$", VF_COMMON | VF_VENDOR, API_VERSION);
+               return Version("Provides support for the /SILENCE command", VF_OPTCOMMON | VF_VENDOR);
        }
 };