]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_shun.cpp
Resolve /STATS S conflict between SVSHOLD and SHUN
[user/henk/code/inspircd.git] / src / modules / m_shun.cpp
index c3cd3a80d2641b552bdde681897af294bb110ff9..017ed174e5db4be77c8f6f2e31ca5235abec6bb4 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
@@ -21,8 +21,8 @@ class Shun : public XLine
 public:
        std::string matchtext;
 
-       Shun(InspIRCd* Instance, time_t s_time, long d, std::string src, std::string re, std::string shunmask)
-               : XLine(Instance, s_time, d, src, re, "SHUN")
+       Shun(time_t s_time, long d, std::string src, std::string re, std::string shunmask)
+               : XLine(s_time, d, src, re, "SHUN")
        {
                this->matchtext = shunmask;
        }
@@ -72,13 +72,13 @@ public:
 class ShunFactory : public XLineFactory
 {
  public:
-       ShunFactory(InspIRCd* Instance) : XLineFactory(Instance, "SHUN") { }
+       ShunFactory() : XLineFactory("SHUN") { }
 
        /** Generate a shun
        */
        XLine* Generate(time_t set_time, long duration, std::string source, std::string reason, std::string xline_specific_mask)
        {
-               return new Shun(ServerInstance, set_time, duration, source, reason, xline_specific_mask);
+               return new Shun(set_time, duration, source, reason, xline_specific_mask);
        }
 };
 
@@ -136,7 +136,7 @@ class CommandShun : public Command
 
                        try
                        {
-                               r = new Shun(ServerInstance, ServerInstance->Time(), duration, user->nick.c_str(), expr.c_str(), target.c_str());
+                               r = new Shun(ServerInstance->Time(), duration, user->nick.c_str(), expr.c_str(), target.c_str());
                        }
                        catch (...)
                        {
@@ -187,7 +187,7 @@ class ModuleShun : public Module
        bool affectopers;
 
  public:
-       ModuleShun(InspIRCd* Me) : Module(Me), cmd(this), f(Me)
+       ModuleShun() : cmd(this)
        {
                ServerInstance->XLines->RegisterFactory(&f);
                ServerInstance->AddCommand(&cmd);
@@ -205,7 +205,7 @@ class ModuleShun : public Module
 
        virtual ModResult OnStats(char symbol, User* user, string_list& out)
        {
-               if (symbol != 'S')
+               if (symbol != 'H')
                        return MOD_RES_PASSTHRU;
 
                ServerInstance->XLines->InvokeStats("SHUN", 223, user, out);
@@ -214,7 +214,7 @@ class ModuleShun : public Module
 
        virtual void OnRehash(User* user)
        {
-               ConfigReader MyConf(ServerInstance);
+               ConfigReader MyConf;
                std::string cmds = MyConf.ReadValue("shun", "enabledcommands", 0);
 
                if (cmds.empty())
@@ -236,7 +236,7 @@ class ModuleShun : public Module
                affectopers = MyConf.ReadFlag("shun", "affectopers", "no", 0);
        }
 
-       virtual void OnUserConnect(User* user)
+       virtual void OnUserConnect(LocalUser* user)
        {
                if (!IS_LOCAL(user))
                        return;
@@ -251,7 +251,7 @@ class ModuleShun : public Module
                }
        }
 
-       virtual ModResult OnPreCommand(std::string &command, std::vector<std::string>& parameters, User* user, bool validated, const std::string &original_line)
+       virtual ModResult OnPreCommand(std::string &command, std::vector<std::string>& parameters, LocalUser* user, bool validated, const std::string &original_line)
        {
                if (validated)
                        return MOD_RES_PASSTHRU;
@@ -294,7 +294,7 @@ class ModuleShun : public Module
 
        virtual Version GetVersion()
        {
-               return Version("$Id$",VF_VENDOR|VF_COMMON,API_VERSION);
+               return Version("Provides the /shun command, which stops a user executing all commands except PING and PONG.",VF_VENDOR|VF_COMMON);
        }
 };