summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/ns_maxemail.c18
-rw-r--r--src/modules/os_ignore_db.c21
-rw-r--r--src/modules/os_info.c34
3 files changed, 19 insertions, 54 deletions
diff --git a/src/modules/ns_maxemail.c b/src/modules/ns_maxemail.c
index 38215dd60..5a6e4ff7e 100644
--- a/src/modules/ns_maxemail.c
+++ b/src/modules/ns_maxemail.c
@@ -20,7 +20,6 @@
void my_load_config();
void my_add_languages();
-int my_event_reload(int argc, char **argv);
CommandReturn check_email_limit_reached(const char *email, User * u);
int NSEmailMax = 0;
@@ -90,10 +89,6 @@ class NSMaxEmail : public Module
this->AddCommand(NICKSERV, new CommandNSRegister(), MOD_HEAD);
this->AddCommand(NICKSERV, new CommandNSSet(), MOD_HEAD);
- evt = createEventHook(EVENT_RELOAD, my_event_reload);
- if ((status = this->AddEventHook(evt)))
- throw ModuleException("ns_maxemail: Unable to hook to EVENT_RELOAD");
-
my_load_config();
const char *langtable_en_us[] = {
@@ -145,6 +140,11 @@ class NSMaxEmail : public Module
this->InsertLanguage(LANG_RU, LNG_NUM_STRINGS, langtable_ru);
this->InsertLanguage(LANG_IT, LNG_NUM_STRINGS, langtable_it);
}
+
+ void OnReload(bool started)
+ {
+ my_load_config();
+ }
};
@@ -185,14 +185,6 @@ CommandReturn check_email_limit_reached(const char *email, User * u)
return MOD_STOP;
}
-int my_event_reload(int argc, char **argv)
-{
- if (argc > 0 && !stricmp(argv[0], EVENT_START))
- my_load_config();
-
- return MOD_CONT;
-}
-
void my_load_config()
{
ConfigReader config;
diff --git a/src/modules/os_ignore_db.c b/src/modules/os_ignore_db.c
index 45a99a665..2497f3b94 100644
--- a/src/modules/os_ignore_db.c
+++ b/src/modules/os_ignore_db.c
@@ -72,7 +72,6 @@ int backup_ignoredb(int argc, char **argv);
void load_ignore_db();
void save_ignore_db();
void load_config();
-int reload_config(int argc, char **argv);
/* ------------------------------------------------------------------------------- */
@@ -88,10 +87,6 @@ class OSIgnoreDB : public Module
this->SetVersion(VERSION);
this->SetType(SUPPORTED);
- hook = createEventHook(EVENT_RELOAD, reload_config);
- if (this->AddEventHook(hook) != MOD_ERR_OK)
- throw ModuleException("os_ignore_db: Can't hook to EVENT_RELOAD event");
-
hook = createEventHook(EVENT_DB_SAVING, save_ignoredb);
if (this->AddEventHook(hook) != MOD_ERR_OK)
throw ModuleException("os_ignore_db: Can't hook to EVENT_DB_SAVING event");
@@ -113,6 +108,11 @@ class OSIgnoreDB : public Module
if (IgnoreDB)
delete [] IgnoreDB;
}
+
+ void OnReload(bool starting)
+ {
+ load_config();
+ }
};
@@ -132,17 +132,6 @@ void load_config() {
alog("[os_ignore_db] debug: Set config vars: OSIgnoreDBName='%s'", IgnoreDB);
}
-/**
- * Upon /os reload call the routines for reloading the configuration directives
- **/
-int reload_config(int argc, char **argv) {
- if (argc >= 1) {
- if (!stricmp(argv[0], EVENT_START)) {
- load_config();
- }
- }
- return MOD_CONT;
-}
/**
* When anope saves her databases, we do the same.
diff --git a/src/modules/os_info.c b/src/modules/os_info.c
index 0c5e040b6..f6e0d3318 100644
--- a/src/modules/os_info.c
+++ b/src/modules/os_info.c
@@ -49,7 +49,6 @@ int mLoadData();
int mSaveData(int argc, char **argv);
int mBackupData(int argc, char **argv);
int mLoadConfig();
-int mEventReload(int argc, char **argv);
static Module *me;
@@ -311,9 +310,6 @@ class OSInfo : public Module
hook = createEventHook(EVENT_DB_BACKUP, mBackupData);
status = this->AddEventHook(hook);
- hook = createEventHook(EVENT_RELOAD, mEventReload);
- status = this->AddEventHook(hook);
-
this->SetNickHelp(mMainNickHelp);
this->SetChanHelp(mMainChanHelp);
@@ -557,6 +553,15 @@ class OSInfo : public Module
if (OSInfoDBName)
delete [] OSInfoDBName;
}
+
+ void OnReload(bool starting)
+ {
+ alog("os_info: Reloading configuration directives...");
+ int ret = mLoadConfig();
+
+ if (ret)
+ alog("os_info.c: ERROR: An error has occured while reloading the configuration file");
+ }
};
/*************************************************************************/
@@ -710,27 +715,6 @@ int mLoadConfig()
return 0;
}
-/**
- * Manage the RELOAD EVENT
- * @return MOD_CONT
- **/
-int mEventReload(int argc, char **argv)
-{
- int ret = 0;
- if (argc >= 1)
- {
- if (!stricmp(argv[0], EVENT_START))
- {
- alog("os_info: Reloading configuration directives...");
- ret = mLoadConfig();
- }
- }
-
- if (ret)
- alog("os_info.c: ERROR: An error has occured while reloading the configuration file");
-
- return MOD_CONT;
-}
/*************************************************************************/