summaryrefslogtreecommitdiff
path: root/src/modules/m_rline.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-09-21 12:24:25 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-09-21 12:24:25 +0000
commit1daa5273d70105f112d93a7528032826c9a66983 (patch)
treee1f2f4a3b15fcce529948469e516b7a7642b8ff2 /src/modules/m_rline.cpp
parentbe609949e3ec2543d6cb16d23240870028732f36 (diff)
Fixes. Dont try and catch exceptions within the RLine ctor, we dont always want crud outputting to snomask x in every situation. Its up to the caller
that creates the object as to what they want to do with the exception and if they want it shown. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10578 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_rline.cpp')
-rw-r--r--src/modules/m_rline.cpp34
1 files changed, 7 insertions, 27 deletions
diff --git a/src/modules/m_rline.cpp b/src/modules/m_rline.cpp
index 3b15ec89e..8fb60385e 100644
--- a/src/modules/m_rline.cpp
+++ b/src/modules/m_rline.cpp
@@ -42,15 +42,10 @@ class CoreExport RLine : public XLine
throw ModuleException("Regex engine not set or loaded!");
}
- try
- {
- regex = RegexFactoryRequest(mymodule, rxengine, regexs).Create();
- }
- catch (ModuleException& ex)
- {
- ServerInstance->SNO->WriteToSnoMask('x', "Bad regex: %s", ex.GetReason());
- throw ex;
- }
+ /* This can throw on failure, but if it does we DONT catch it here, we catch it and display it
+ * where the object is created, we might not ALWAYS want it to output stuff to snomask x all the time
+ */
+ regex = RegexFactoryRequest(mymodule, rxengine, regexs).Create();
}
/** Destructor
@@ -62,28 +57,13 @@ class CoreExport RLine : public XLine
bool Matches(User *u)
{
- std::string compare = std::string(u->nick) + "!" + u->ident + "@" + u->host + " " + u->fullname;
-
- ServerInstance->Logs->Log("m_rline",DEBUG, "Matching " + matchtext + " against string " + compare);
-
- if (regex->Matches(compare))
- {
- // Bang. :D
- return true;
- }
-
- return false;
+ std::string compare = u->nick + "!" + u->ident + "@" + u->host + " " + u->fullname;
+ return regex->Matches(compare);
}
bool Matches(const std::string &compare)
{
- if (regex->Matches(compare))
- {
- // Bang. :D
- return true;
- }
-
- return false;
+ return regex->Matches(compare);
}
void Apply(User* u)