X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_regex_glob.cpp;h=ef843cc767e07e0ff30150b2fda9c56d852196be;hb=7107ec12d8640d35cfe3d5002db1bc1deb33625d;hp=8990995cf7fd91da8f01fee87d30a33574410967;hpb=86ac9c800fbb4371b45d3cf599ee9d8d07a1e4ab;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_regex_glob.cpp b/src/modules/m_regex_glob.cpp index 8990995cf..ef843cc76 100644 --- a/src/modules/m_regex_glob.cpp +++ b/src/modules/m_regex_glob.cpp @@ -2,8 +2,8 @@ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * - * InspIRCd: (C) 2002-2008 InspIRCd Development Team - * See: http://www.inspircd.org/wiki/index.php/Credits + * InspIRCd: (C) 2002-2009 InspIRCd Development Team + * See: http://wiki.inspircd.org/Credits * * This program is free but copyrighted software; see * the file COPYING for details. @@ -20,7 +20,7 @@ class GlobRegex : public Regex { public: - GlobRegex(const std::string& rx, InspIRCd* Me) : Regex(rx, Me) + GlobRegex(const std::string& rx) : Regex(rx) { } @@ -30,23 +30,22 @@ public: virtual bool Matches(const std::string& text) { - return InspIRCd::Match(this->regex_string, text); + return InspIRCd::Match(text, this->regex_string); } }; class ModuleRegexGlob : public Module { public: - ModuleRegexGlob(InspIRCd* Me) : Module(Me) - { - Me->Modules->PublishInterface("RegularExpression", this); + ModuleRegexGlob() { + ServerInstance->Modules->PublishInterface("RegularExpression", this); Implementation eventlist[] = { I_OnRequest }; - Me->Modules->Attach(eventlist, this, 1); + ServerInstance->Modules->Attach(eventlist, this, 1); } virtual Version GetVersion() { - return Version("$Id$", VF_COMMON | VF_VENDOR | VF_SERVICEPROVIDER, API_VERSION); + return Version("Regex module using plain wildcard matching.", VF_COMMON | VF_VENDOR | VF_SERVICEPROVIDER, API_VERSION); } virtual ~ModuleRegexGlob() @@ -64,7 +63,7 @@ public: { RegexFactoryRequest* rfr = (RegexFactoryRequest*)request; std::string rx = rfr->GetRegex(); - rfr->result = (Regex*)new GlobRegex(rx, ServerInstance); + rfr->result = new GlobRegex(rx); return "OK"; } return NULL;