From d07de70fc3156e143beeb04c0e2bbfb592415ead Mon Sep 17 00:00:00 2001 From: rburchell Date: Mon, 16 Feb 2009 23:48:03 +0000 Subject: Move EVENT_RELOAD to OnReload. git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2103 5417fbe8-f217-4b02-8779-1006273d7864 --- src/core/os_news.c | 22 +++++----------------- src/core/os_reload.c | 3 ++- 2 files changed, 7 insertions(+), 18 deletions(-) (limited to 'src/core') 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(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; } -- cgit