]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_svshold.cpp
Improvements and bugfixes to the cgiirc module.
[user/henk/code/inspircd.git] / src / modules / m_svshold.cpp
index ad6a4d1aaa15255020389a116cf86f047053be51..e74f3324ba936ff324326d4f94b86fbd273e5df8 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "inspircd.h"
 #include "xline.h"
+#include "modules/stats.h"
 
 namespace
 {
@@ -41,19 +42,19 @@ public:
                this->nickname = nick;
        }
 
-       bool Matches(User *u)
+       bool Matches(User* u) CXX11_OVERRIDE
        {
                if (u->nick == nickname)
                        return true;
                return false;
        }
 
-       bool Matches(const std::string &s)
+       bool Matches(const std::string& s) CXX11_OVERRIDE
        {
                return InspIRCd::Match(s, nickname);
        }
 
-       void DisplayExpiry()
+       void DisplayExpiry() CXX11_OVERRIDE
        {
                if (!silent)
                {
@@ -62,7 +63,7 @@ public:
                }
        }
 
-       const std::string& Displayable()
+       const std::string& Displayable() CXX11_OVERRIDE
        {
                return nickname;
        }
@@ -77,12 +78,12 @@ class SVSHoldFactory : public XLineFactory
 
        /** Generate a shun
        */
-       XLine* Generate(time_t set_time, long duration, std::string source, std::string reason, std::string xline_specific_mask)
+       XLine* Generate(time_t set_time, long duration, std::string source, std::string reason, std::string xline_specific_mask) CXX11_OVERRIDE
        {
                return new SVSHold(set_time, duration, source, reason, xline_specific_mask);
        }
 
-       bool AutoApplyToUserList(XLine *x)
+       bool AutoApplyToUserList(XLine* x) CXX11_OVERRIDE
        {
                return false;
        }
@@ -98,7 +99,7 @@ class CommandSvshold : public Command
                flags_needed = 'o'; this->syntax = "<nickname> [<duration> :<reason>]";
        }
 
-       CmdResult Handle(const std::vector<std::string> &parameters, User *user)
+       CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE
        {
                /* syntax: svshold nickname time :reason goes here */
                /* 'time' is a human-readable timestring, like 2d3h2s. */
@@ -155,20 +156,22 @@ class CommandSvshold : public Command
                return CMD_SUCCESS;
        }
 
-       RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters)
+       RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE
        {
                return ROUTE_BROADCAST;
        }
 };
 
-class ModuleSVSHold : public Module
+class ModuleSVSHold : public Module, public Stats::EventListener
 {
        CommandSvshold cmd;
        SVSHoldFactory s;
 
 
  public:
-       ModuleSVSHold() : cmd(this)
+       ModuleSVSHold()
+               : Stats::EventListener(this)
+               , cmd(this)
        {
        }