diff options
Diffstat (limited to 'src/modules/extra/m_regex_pcre.cpp')
-rw-r--r-- | src/modules/extra/m_regex_pcre.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/modules/extra/m_regex_pcre.cpp b/src/modules/extra/m_regex_pcre.cpp index 782847736..16d0cfe15 100644 --- a/src/modules/extra/m_regex_pcre.cpp +++ b/src/modules/extra/m_regex_pcre.cpp @@ -72,8 +72,6 @@ class ModuleRegexPCRE : public Module public: ModuleRegexPCRE() { ServerInstance->Modules->PublishInterface("RegularExpression", this); - Implementation eventlist[] = { I_OnRequest }; - ServerInstance->Modules->Attach(eventlist, this, 1); } virtual Version GetVersion() @@ -86,20 +84,18 @@ public: ServerInstance->Modules->UnpublishInterface("RegularExpression", this); } - virtual const char* OnRequest(Request* request) + void OnRequest(Request& request) { - if (strcmp("REGEX-NAME", request->GetId()) == 0) + if (strcmp("REGEX-NAME", request.id) == 0) { - return "pcre"; + static_cast<RegexNameRequest&>(request).result = "pcre"; } - else if (strcmp("REGEX", request->GetId()) == 0) + else if (strcmp("REGEX", request.id) == 0) { - RegexFactoryRequest* rfr = (RegexFactoryRequest*)request; - std::string rx = rfr->GetRegex(); - rfr->result = new PCRERegex(rx); - return "OK"; + RegexFactoryRequest& rfr = (RegexFactoryRequest&)request; + std::string rx = rfr.GetRegex(); + rfr.result = new PCRERegex(rx); } - return NULL; } }; |