]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_svshold.cpp
Change the API of m_sslinfo to be dynamic_reference-based
[user/henk/code/inspircd.git] / src / modules / m_svshold.cpp
index 971acf1f5242327a70335f2407d50c6fd6cb7af1..a53298126646c48b5c4f55c4a8a75b68f7a61ce7 100644 (file)
 class SVSHold : public XLine
 {
 public:
-       irc::string nickname;
+       std::string nickname;
 
-       SVSHold(time_t s_time, long d, std::string src, std::string re, std::string nick)
+       SVSHold(time_t s_time, long d, const std::string& src, const std::string& re, const std::string& nick)
                : XLine(s_time, d, src, re, "SVSHOLD")
        {
-               this->nickname = nick.c_str();
+               this->nickname = nick;
        }
 
        bool Matches(User *u)
@@ -47,14 +47,12 @@ public:
 
        bool Matches(const std::string &s)
        {
-               if (nickname == s)
-                       return true;
-               return false;
+               return InspIRCd::Match(s, nickname);
        }
 
-       const char* Displayable()
+       const std::string& Displayable()
        {
-               return nickname.c_str();
+               return nickname;
        }
 };
 
@@ -159,7 +157,7 @@ class ModuleSVSHold : public Module
        {
        }
 
-       void init()
+       void init() CXX11_OVERRIDE
        {
                ServerInstance->XLines->RegisterFactory(&s);
                ServerInstance->Modules->AddService(cmd);
@@ -167,7 +165,7 @@ class ModuleSVSHold : public Module
                ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
        }
 
-       virtual ModResult OnStats(char symbol, User* user, string_list &out)
+       ModResult OnStats(char symbol, User* user, string_list &out) CXX11_OVERRIDE
        {
                if(symbol != 'S')
                        return MOD_RES_PASSTHRU;
@@ -176,7 +174,7 @@ class ModuleSVSHold : public Module
                return MOD_RES_DENY;
        }
 
-       virtual ModResult OnUserPreNick(User *user, const std::string &newnick)
+       ModResult OnUserPreNick(User *user, const std::string &newnick) CXX11_OVERRIDE
        {
                XLine *rl = ServerInstance->XLines->MatchesLine("SVSHOLD", newnick);
 
@@ -189,13 +187,13 @@ class ModuleSVSHold : public Module
                return MOD_RES_PASSTHRU;
        }
 
-       virtual ~ModuleSVSHold()
+       ~ModuleSVSHold()
        {
                ServerInstance->XLines->DelAll("SVSHOLD");
                ServerInstance->XLines->UnregisterFactory(&s);
        }
 
-       virtual Version GetVersion()
+       Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Implements SVSHOLD. Like Q:Lines, but can only be added/removed by Services.", VF_COMMON | VF_VENDOR);
        }