summaryrefslogtreecommitdiff
path: root/src/modules/extra/m_regex_posix.cpp
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-08 23:29:21 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-08 23:29:21 +0000
commit7e843c22e16c81054bad18073d24fe1a07026431 (patch)
tree44ca0213c7d7a80270b993fec1fbed275ec56424 /src/modules/extra/m_regex_posix.cpp
parentc440038736f749a56dbac1badee5b2f099286117 (diff)
Update Event and Request APIs
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11808 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/extra/m_regex_posix.cpp')
-rw-r--r--src/modules/extra/m_regex_posix.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/modules/extra/m_regex_posix.cpp b/src/modules/extra/m_regex_posix.cpp
index 7afaad076..62b44e0e4 100644
--- a/src/modules/extra/m_regex_posix.cpp
+++ b/src/modules/extra/m_regex_posix.cpp
@@ -78,8 +78,8 @@ private:
public:
ModuleRegexPOSIX() {
ServerInstance->Modules->PublishInterface("RegularExpression", this);
- Implementation eventlist[] = { I_OnRequest, I_OnRehash };
- ServerInstance->Modules->Attach(eventlist, this, 2);
+ Implementation eventlist[] = { I_OnRehash };
+ ServerInstance->Modules->Attach(eventlist, this, 1);
OnRehash(NULL);
}
@@ -99,20 +99,18 @@ public:
extended = Conf.ReadFlag("posix", "extended", 0);
}
- 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 "posix";
+ static_cast<RegexNameRequest&>(request).result = "posix";
}
- 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 POSIXRegex(rx, extended);
- return "OK";
+ RegexFactoryRequest& rfr = (RegexFactoryRequest&)request;
+ std::string rx = rfr.GetRegex();
+ rfr.result = new POSIXRegex(rx, extended);
}
- return NULL;
}
};