]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/extra/m_regex_posix.cpp
Remove current time parameter of the Timer constructor
[user/henk/code/inspircd.git] / src / modules / extra / m_regex_posix.cpp
index 6c52a935b6724cb65738e6f05c77d86b2762cff8..b5fddfab8f2c0e748aa35cb22fcc861bc2eeb90f 100644 (file)
@@ -54,14 +54,9 @@ class POSIXRegex : public Regex
                regfree(&regbuf);
        }
 
-       bool Matches(const std::string& text)
+       bool Matches(const std::string& text) CXX11_OVERRIDE
        {
-               if (regexec(&regbuf, text.c_str(), 0, NULL, 0) == 0)
-               {
-                       // Bang. :D
-                       return true;
-               }
-               return false;
+               return (regexec(&regbuf, text.c_str(), 0, NULL, 0) == 0);
        }
 };
 
@@ -70,7 +65,7 @@ class PosixFactory : public RegexFactory
  public:
        bool extended;
        PosixFactory(Module* m) : RegexFactory(m, "regex/posix") {}
-       Regex* Create(const std::string& expr)
+       Regex* Create(const std::string& expr) CXX11_OVERRIDE
        {
                return new POSIXRegex(expr, extended);
        }
@@ -83,8 +78,6 @@ class ModuleRegexPOSIX : public Module
  public:
        ModuleRegexPOSIX() : ref(this)
        {
-               ServerInstance->Modules->AddService(ref);
-               OnRehash(NULL);
        }
 
        Version GetVersion() CXX11_OVERRIDE
@@ -92,7 +85,7 @@ class ModuleRegexPOSIX : public Module
                return Version("Regex Provider Module for POSIX Regular Expressions", VF_VENDOR);
        }
 
-       void OnRehash(User* u) CXX11_OVERRIDE
+       void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
        {
                ref.extended = ServerInstance->Config->ConfValue("posix")->getBool("extended");
        }