]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_rline.cpp
Fix some of the include guard names (requested by SaberUK)
[user/henk/code/inspircd.git] / src / modules / m_rline.cpp
index 9d9ed40dd0a739c01b1a58d608b9d02b40701921..0df36eb37e8f4e45609b1f0320cb24083a712c79 100644 (file)
@@ -201,10 +201,13 @@ class ModuleRLine : public Module
        RLineFactory f;
        CommandRLine r;
        bool MatchOnNickChange;
-       std::string RegexEngine;
 
  public:
        ModuleRLine() : rxfactory(this, "regex"), f(rxfactory), r(this, f)
+       {
+       }
+
+       void init()
        {
                OnRehash(NULL);
 
@@ -223,7 +226,7 @@ class ModuleRLine : public Module
 
        virtual Version GetVersion()
        {
-               return Version("RLINE: Regexp user banning.", VF_COMMON | VF_VENDOR);
+               return Version("RLINE: Regexp user banning.", VF_COMMON | VF_VENDOR, rxfactory ? rxfactory->name : "");
        }
 
        virtual void OnUserConnect(LocalUser* user)
@@ -249,10 +252,13 @@ class ModuleRLine : public Module
                ZlineOnMatch = Conf.ReadFlag("rline", "zlineonmatch", 0);
                std::string newrxengine = Conf.ReadValue("rline", "engine", 0);
 
-               rxfactory.SetProvider("regex/" + newrxengine);
+               if (newrxengine.empty())
+                       rxfactory.SetProvider("regex");
+               else
+                       rxfactory.SetProvider("regex/" + newrxengine);
                if (!rxfactory)
                {
-                       ServerInstance->SNO->WriteToSnoMask('a', "WARNING: Regex engine '%s' is not loaded - R-Line functionality disabled until this is corrected.", RegexEngine.c_str());
+                       ServerInstance->SNO->WriteToSnoMask('a', "WARNING: Regex engine '%s' is not loaded - R-Line functionality disabled until this is corrected.", newrxengine.c_str());
                }
        }