mirror of
https://github.com/anope/anope.git
synced 2026-07-05 18:03:13 +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:
+5
-17
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user