summaryrefslogtreecommitdiff
path: root/src/events.c
diff options
context:
space:
mode:
authorRobin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864>2008-11-08 01:30:43 +0000
committerRobin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864>2008-11-08 01:30:43 +0000
commit26cdf257cc864b9ca91e4424e4bc31dc766b2c5d (patch)
treee4902d9f7920b7a81d138e22e32d1890ac847922 /src/events.c
parent7571ca327e33f649f954604396c1d97c2714b0e0 (diff)
moduleAddEventHook -> Module::AddEventHook.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1587 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/events.c')
-rw-r--r--src/events.c39
1 files changed, 11 insertions, 28 deletions
diff --git a/src/events.c b/src/events.c
index f8a6f1601..006c3273e 100644
--- a/src/events.c
+++ b/src/events.c
@@ -477,38 +477,21 @@ int addCoreEventHook(EvtHookHash * hookEvtTable[], EvtHook * evh)
return addEventHook(hookEvtTable, evh);
}
-/**
- * Add a module message to the IRCD message hash
- * @param m the Message to add
- * @param pos the Position to add the message to, e.g. MOD_HEAD, MOD_TAIL, MOD_UNIQUE
- * @return MOD_ERR_OK on success, althing else on fail.
- **/
-int moduleAddEventHandler(EvtMessage * evm)
+int Module::AddEventHandler(EvtMessage *evm)
{
- int status;
-
- if (!evm) {
- return MOD_ERR_PARAMS;
- }
+ int status;
- /* ok, this appears to be a module adding a message from outside of AnopeInit, try to look up its module struct for it */
- if ((mod_current_module_name) && (!mod_current_module)) {
- mod_current_module = findModule(mod_current_module_name);
- }
+ if (!evm)
+ return MOD_ERR_PARAMS;
- if (!mod_current_module) {
- return MOD_ERR_UNKNOWN;
- } /* shouldnt happen */
- evm->core = 0;
- if (!evm->mod_name) {
- evm->mod_name = sstrdup(mod_current_module->name.c_str());
- }
+ evm->core = 0;
+ if (!evm->mod_name)
+ evm->mod_name = sstrdup(this->name.c_str());
- status = addEventHandler(EVENT, evm);
- if (debug) {
- displayEvtMessageFromHash(evm->name);
- }
- return status;
+ status = addEventHandler(EVENT, evm);
+ if (debug)
+ displayEvtMessageFromHash(evm->name);
+ return status;
}
int Module::AddEventHook(EvtHook *evh)