diff options
author | rburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-02-16 23:48:03 +0000 |
---|---|---|
committer | rburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-02-16 23:48:03 +0000 |
commit | d07de70fc3156e143beeb04c0e2bbfb592415ead (patch) | |
tree | c6f246b68054048f12bf9527c9179014eb544102 /src/core | |
parent | c1c9e17d7995f7e6684316f6dc71d1b43788533f (diff) |
Move EVENT_RELOAD to OnReload.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2103 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/os_news.c | 22 | ||||
-rw-r--r-- | src/core/os_reload.c | 3 |
2 files changed, 7 insertions, 18 deletions
diff --git a/src/core/os_news.c b/src/core/os_news.c index cc32f8604..e17022e40 100644 --- a/src/core/os_news.c +++ b/src/core/os_news.c @@ -34,7 +34,6 @@ void myOperServHelp(User *u); -int reload_config(int argc, char **argv); struct newsmsgs { int16 type; @@ -381,10 +380,12 @@ class OSNews : public Module this->AddCommand(OPERSERV, new CommandOSRandomNews(), MOD_UNIQUE); this->SetOperHelp(myOperServHelp); + } - EvtHook *hook = createEventHook(EVENT_RELOAD, reload_config); - if (this->AddEventHook(hook) != MOD_ERR_OK) - throw ModuleException("os_news: Can't hook to EVENT_RELOAD event"); + void reload_config(bool starting) + { + OSLogonNews->UpdateHelpParam(); + OSOperNews->UpdateHelpParam(); } }; @@ -403,18 +404,5 @@ void myOperServHelp(User *u) } } -/** - * Upon /os reload refresh the count - **/ -int reload_config(int argc, char **argv) -{ - if (argc >= 1 && !stricmp(argv[0], EVENT_START)) - { - OSLogonNews->UpdateHelpParam(); - OSOperNews->UpdateHelpParam(); - } - - return MOD_CONT; -} MODULE_INIT("os_news", OSNews) diff --git a/src/core/os_reload.c b/src/core/os_reload.c index 400b61f3e..c7f651825 100644 --- a/src/core/os_reload.c +++ b/src/core/os_reload.c @@ -35,7 +35,8 @@ class CommandOSReload : public Command sprintf(const_cast<char *>(quitmsg), /* XXX */ "Error during the reload of the configuration file!"); quitting = 1; } - send_event(EVENT_RELOAD, 1, EVENT_START); + + FOREACH_MOD(I_OnReload, OnReload(false)); notice_lang(s_OperServ, u, OPER_RELOAD); return MOD_CONT; } |