summaryrefslogtreecommitdiff
path: root/src/modules/m_rline.cpp
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2010-01-14 20:51:31 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2010-01-14 20:51:31 +0000
commit916112b03fdcf44ed5c9904a2fbecb67773e2364 (patch)
treef3d363dabb4671d39c8f142d7a25d057f2229576 /src/modules/m_rline.cpp
parentac16c04171590ef30ddc2bd0becc2c781446a4f2 (diff)
Allow regex engine to be omitted in configuration to use automatic binding
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12261 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_rline.cpp')
-rw-r--r--src/modules/m_rline.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/modules/m_rline.cpp b/src/modules/m_rline.cpp
index 7f5eafd69..d52870284 100644
--- a/src/modules/m_rline.cpp
+++ b/src/modules/m_rline.cpp
@@ -201,7 +201,6 @@ class ModuleRLine : public Module
RLineFactory f;
CommandRLine r;
bool MatchOnNickChange;
- std::string RegexEngine;
public:
ModuleRLine() : rxfactory(this, "regex"), f(rxfactory), r(this, f)
@@ -223,7 +222,7 @@ class ModuleRLine : public Module
virtual Version GetVersion()
{
- return Version("RLINE: Regexp user banning.", VF_COMMON | VF_VENDOR, rxfactory.GetProvider());
+ return Version("RLINE: Regexp user banning.", VF_COMMON | VF_VENDOR, rxfactory ? rxfactory->name : "");
}
virtual void OnUserConnect(LocalUser* user)
@@ -249,10 +248,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());
}
}