mirror of
https://github.com/anope/anope.git
synced 2026-06-29 12:56:38 +02:00
Move EVENT_RELOAD to OnReload.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2103 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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.
|
||||
|
||||
+9
-25
@@ -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;
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user