From 578da38d30893ca33cc1aa9183e4b82d67c831f3 Mon Sep 17 00:00:00 2001 From: cyberbotx Date: Mon, 6 Apr 2009 21:25:56 +0000 Subject: Replace Set*Help() functions with virtual *ServHelp() functions that can be overriden in a module's Module class. Patch from Adam. git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2266 5417fbe8-f217-4b02-8779-1006273d7864 --- src/core/bs_act.c | 18 ++++------------- src/core/bs_assign.c | 17 ++++------------ src/core/bs_badwords.c | 17 ++++------------ src/core/bs_bot.c | 20 ++++--------------- src/core/bs_botlist.c | 19 ++++-------------- src/core/bs_help.c | 2 +- src/core/bs_info.c | 18 ++++------------- src/core/bs_kick.c | 18 ++++------------- src/core/bs_say.c | 19 ++++-------------- src/core/bs_set.c | 18 ++++------------- src/core/bs_unassign.c | 18 ++++------------- src/core/cs_access.c | 20 +++++-------------- src/core/cs_akick.c | 21 ++++---------------- src/core/cs_ban.c | 20 +++++-------------- src/core/cs_clear.c | 17 ++++------------ src/core/cs_drop.c | 18 ++++------------- src/core/cs_forbid.c | 17 ++++------------ src/core/cs_getkey.c | 16 ++++----------- src/core/cs_getpass.c | 15 ++++---------- src/core/cs_help.c | 2 +- src/core/cs_identify.c | 19 ++++-------------- src/core/cs_info.c | 17 ++++------------ src/core/cs_invite.c | 16 ++++----------- src/core/cs_kick.c | 15 ++++---------- src/core/cs_list.c | 21 +++++++------------- src/core/cs_logout.c | 16 ++++----------- src/core/cs_modes.c | 51 +++++++++++++++++++++--------------------------- src/core/cs_register.c | 17 ++++------------ src/core/cs_sendpass.c | 17 ++++------------ src/core/cs_set.c | 11 ++++------- src/core/cs_status.c | 17 ++++------------ src/core/cs_suspend.c | 19 +++++------------- src/core/cs_topic.c | 17 ++++------------ src/core/cs_xop.c | 24 ++++++++--------------- src/core/hs_del.c | 17 ++++------------ src/core/hs_delall.c | 17 ++++------------ src/core/hs_group.c | 16 ++++----------- src/core/hs_help.c | 2 +- src/core/hs_list.c | 16 ++++----------- src/core/hs_off.c | 17 ++++------------ src/core/hs_on.c | 17 ++++------------ src/core/hs_set.c | 17 ++++------------ src/core/hs_setall.c | 15 ++++---------- src/core/ms_cancel.c | 14 ++++--------- src/core/ms_check.c | 16 ++++----------- src/core/ms_del.c | 15 ++++---------- src/core/ms_help.c | 2 +- src/core/ms_info.c | 16 ++++----------- src/core/ms_list.c | 15 ++++---------- src/core/ms_read.c | 15 ++++---------- src/core/ms_rsend.c | 16 ++++----------- src/core/ms_send.c | 16 ++++----------- src/core/ms_sendall.c | 16 ++++----------- src/core/ms_set.c | 17 ++++------------ src/core/ms_staff.c | 16 ++++----------- src/core/ns_access.c | 17 ++++------------ src/core/ns_alist.c | 17 ++++------------ src/core/ns_drop.c | 17 ++++------------ src/core/ns_forbid.c | 16 ++++----------- src/core/ns_getemail.c | 17 ++++------------ src/core/ns_getpass.c | 17 ++++------------ src/core/ns_ghost.c | 17 ++++------------ src/core/ns_group.c | 19 +++++------------- src/core/ns_help.c | 2 +- src/core/ns_identify.c | 17 ++++------------ src/core/ns_info.c | 17 ++++------------ src/core/ns_list.c | 19 +++++------------- src/core/ns_logout.c | 17 ++++------------ src/core/ns_recover.c | 17 ++++------------ src/core/ns_register.c | 24 ++++++++--------------- src/core/ns_release.c | 17 ++++------------ src/core/ns_saset.c | 17 ++++------------ src/core/ns_sendpass.c | 17 ++++------------ src/core/ns_set.c | 17 ++++------------ src/core/ns_status.c | 17 ++++------------ src/core/ns_suspend.c | 19 +++++------------- src/core/ns_update.c | 17 ++++------------ src/core/os_admin.c | 16 ++++----------- src/core/os_akill.c | 16 ++++----------- src/core/os_chankill.c | 17 ++++------------ src/core/os_chanlist.c | 17 ++++------------ src/core/os_clearmodes.c | 17 ++++------------ src/core/os_defcon.c | 17 ++++------------ src/core/os_global.c | 16 ++++----------- src/core/os_help.c | 2 +- src/core/os_ignore.c | 17 ++++------------ src/core/os_jupe.c | 17 ++++------------ src/core/os_kick.c | 17 ++++------------ src/core/os_mode.c | 17 ++++------------ src/core/os_modinfo.c | 17 ++++------------ src/core/os_modlist.c | 18 ++++------------- src/core/os_modload.c | 18 ++++------------- src/core/os_modunload.c | 18 ++++------------- src/core/os_news.c | 25 ++++++------------------ src/core/os_noop.c | 19 ++++-------------- src/core/os_oline.c | 19 ++++-------------- src/core/os_oper.c | 17 ++++------------ src/core/os_quit.c | 18 ++++------------- src/core/os_reload.c | 18 ++++------------- src/core/os_restart.c | 17 ++++------------ src/core/os_session.c | 19 +++++------------- src/core/os_set.c | 17 ++++------------ src/core/os_sgline.c | 16 ++++----------- src/core/os_shutdown.c | 18 ++++------------- src/core/os_sqline.c | 16 ++++----------- src/core/os_staff.c | 17 ++++------------ src/core/os_stats.c | 17 ++++------------ src/core/os_svsnick.c | 17 ++++------------ src/core/os_szline.c | 16 ++++----------- src/core/os_umode.c | 17 ++++------------ src/core/os_update.c | 18 ++++------------- src/core/os_userlist.c | 18 ++++------------- 112 files changed, 468 insertions(+), 1414 deletions(-) (limited to 'src/core') diff --git a/src/core/bs_act.c b/src/core/bs_act.c index 3003e5afa..758ebc82c 100644 --- a/src/core/bs_act.c +++ b/src/core/bs_act.c @@ -15,8 +15,6 @@ #include "module.h" -void myBotServHelp(User * u); - class CommandBSAct : public Command { public: @@ -81,19 +79,11 @@ class BSAct : public Module this->SetVersion("$Id$"); this->SetType(CORE); this->AddCommand(BOTSERV, new CommandBSAct(), MOD_UNIQUE); - - this->SetBotHelp(myBotServHelp); + } + void BotServHelp(User *u) + { + notice_lang(s_BotServ, u, BOT_HELP_CMD_ACT); } }; - -/** - * Add the help response to Anopes /bs help output. - * @param u The user who is requesting help - **/ -void myBotServHelp(User * u) -{ - notice_lang(s_BotServ, u, BOT_HELP_CMD_ACT); -} - MODULE_INIT("bs_act", BSAct) diff --git a/src/core/bs_assign.c b/src/core/bs_assign.c index f4b891820..913e68224 100644 --- a/src/core/bs_assign.c +++ b/src/core/bs_assign.c @@ -15,8 +15,6 @@ #include "module.h" -void myBotServHelp(User * u); - class CommandBSAssign : public Command { public: @@ -93,18 +91,11 @@ class BSAssign : public Module this->SetVersion("$Id$"); this->SetType(CORE); this->AddCommand(BOTSERV, new CommandBSAssign, MOD_UNIQUE); - - this->SetBotHelp(myBotServHelp); + } + void BotServHelp(User *u) + { + notice_lang(s_BotServ, u, BOT_HELP_CMD_ASSIGN); } }; -/** - * Add the help response to Anopes /bs help output. - * @param u The user who is requesting help - **/ -void myBotServHelp(User * u) -{ - notice_lang(s_BotServ, u, BOT_HELP_CMD_ASSIGN); -} - MODULE_INIT("bs_assign", BSAssign) diff --git a/src/core/bs_badwords.c b/src/core/bs_badwords.c index 00d1bace2..627d84569 100644 --- a/src/core/bs_badwords.c +++ b/src/core/bs_badwords.c @@ -15,7 +15,6 @@ #include "module.h" -void myBotServHelp(User * u); int badwords_del_callback(User * u, int num, va_list args); int badwords_list(User * u, int index, ChannelInfo * ci, int *sent_header); int badwords_list_callback(User * u, int num, va_list args); @@ -311,21 +310,13 @@ class BSBadwords : public Module this->SetVersion("$Id$"); this->SetType(CORE); this->AddCommand(BOTSERV, new CommandBSBadwords, MOD_UNIQUE); - - this->SetBotHelp(myBotServHelp); + } + void BotServHelp(User *u) + { + notice_lang(s_BotServ, u, BOT_HELP_CMD_BADWORDS); } }; - -/** - * Add the help response to Anopes /bs help output. - * @param u The user who is requesting help - **/ -void myBotServHelp(User * u) -{ - notice_lang(s_BotServ, u, BOT_HELP_CMD_BADWORDS); -} - int badwords_del_callback(User * u, int num, va_list args) { BadWord *bw; diff --git a/src/core/bs_bot.c b/src/core/bs_bot.c index 36aa70b73..dc48cb628 100644 --- a/src/core/bs_bot.c +++ b/src/core/bs_bot.c @@ -15,8 +15,6 @@ #include "module.h" -void myBotServHelp(User * u); - class CommandBSBot : public Command { private: @@ -446,21 +444,11 @@ class BSBot : public Module this->SetVersion("$Id$"); this->SetType(CORE); this->AddCommand(BOTSERV, new CommandBSBot(), MOD_UNIQUE); - - this->SetBotHelp(myBotServHelp); + } + void BotServHelp(User *u) + { + notice_lang(s_BotServ, u, BOT_HELP_CMD_BOT); } }; - -/** - * Add the help response to Anopes /bs help output. - * @param u The user who is requesting help - **/ -void myBotServHelp(User * u) -{ - notice_lang(s_BotServ, u, BOT_HELP_CMD_BOT); -} - - - MODULE_INIT("bs_bot", BSBot) diff --git a/src/core/bs_botlist.c b/src/core/bs_botlist.c index 190f3d9f9..e363c8545 100644 --- a/src/core/bs_botlist.c +++ b/src/core/bs_botlist.c @@ -15,8 +15,6 @@ #include "module.h" -void myBotServHelp(User * u); - class CommandBSBotList : public Command { public: @@ -81,20 +79,11 @@ class BSBotList : public Module this->SetVersion("$Id$"); this->SetType(CORE); this->AddCommand(BOTSERV, new CommandBSBotList(), MOD_UNIQUE); - - this->SetBotHelp(myBotServHelp); + } + void BotServHelp(User *u) + { + notice_lang(s_BotServ, u, BOT_HELP_CMD_BOTLIST); } }; - -/** - * Add the help response to Anopes /bs help output. - * @param u The user who is requesting help - **/ -void myBotServHelp(User * u) -{ - notice_lang(s_BotServ, u, BOT_HELP_CMD_BOTLIST); -} - - MODULE_INIT("bs_botlist", BSBotList) diff --git a/src/core/bs_help.c b/src/core/bs_help.c index ae26ab9d1..92a595a1d 100644 --- a/src/core/bs_help.c +++ b/src/core/bs_help.c @@ -33,7 +33,7 @@ class CommandBSHelp : public Command { // Abuse syntax error to display general list help. notice_help(s_BotServ, u, BOT_HELP); - moduleDisplayHelp(4, u); + moduleDisplayHelp(s_BotServ, u); notice_help(s_BotServ, u, BOT_HELP_FOOTER, BSMinUsers); } }; diff --git a/src/core/bs_info.c b/src/core/bs_info.c index 36625a731..0541d747e 100644 --- a/src/core/bs_info.c +++ b/src/core/bs_info.c @@ -15,8 +15,6 @@ #include "module.h" -void myBotServHelp(User * u); - class CommandBSInfo : public Command { private: @@ -258,19 +256,11 @@ class BSInfo : public Module this->SetVersion("$Id$"); this->SetType(CORE); this->AddCommand(BOTSERV, new CommandBSInfo(), MOD_UNIQUE); - - this->SetBotHelp(myBotServHelp); + } + void BotServHelp(User *u) + { + notice_lang(s_BotServ, u, BOT_HELP_CMD_INFO); } }; - -/** - * Add the help response to Anopes /bs help output. - * @param u The user who is requesting help - **/ -void myBotServHelp(User * u) -{ - notice_lang(s_BotServ, u, BOT_HELP_CMD_INFO); -} - MODULE_INIT("bs_info", BSInfo) diff --git a/src/core/bs_kick.c b/src/core/bs_kick.c index 1e7787f03..a39cb6b6d 100644 --- a/src/core/bs_kick.c +++ b/src/core/bs_kick.c @@ -17,7 +17,6 @@ int do_kickcmd(User * u); -void myBotServHelp(User * u); class CommandBSKick : public Command { public: @@ -352,20 +351,11 @@ class BSKick : public Module this->SetVersion("$Id$"); this->SetType(CORE); this->AddCommand(BOTSERV, new CommandBSKick(), MOD_UNIQUE); - - this->SetBotHelp(myBotServHelp); + } + void BotServHelp(User *u) + { + notice_lang(s_BotServ, u, BOT_HELP_CMD_KICK); } }; - -/** - * Add the help response to Anopes /bs help output. - * @param u The user who is requesting help - **/ -void myBotServHelp(User * u) -{ - notice_lang(s_BotServ, u, BOT_HELP_CMD_KICK); -} - - MODULE_INIT("bs_kick", BSKick) diff --git a/src/core/bs_say.c b/src/core/bs_say.c index 153a20eb2..5a262e4b7 100644 --- a/src/core/bs_say.c +++ b/src/core/bs_say.c @@ -15,8 +15,6 @@ #include "module.h" -void myBotServHelp(User * u); - class CommandBSSay : public Command { public: @@ -90,20 +88,11 @@ class BSSay : public Module this->SetVersion("$Id$"); this->SetType(CORE); this->AddCommand(BOTSERV, new CommandBSSay(), MOD_UNIQUE); - - this->SetBotHelp(myBotServHelp); + } + void BotServHelp(User *u) + { + notice_lang(s_BotServ, u, BOT_HELP_CMD_SAY); } }; - -/** - * Add the help response to Anopes /bs help output. - * @param u The user who is requesting help - **/ -void myBotServHelp(User * u) -{ - notice_lang(s_BotServ, u, BOT_HELP_CMD_SAY); -} - - MODULE_INIT("bs_say", BSSay) diff --git a/src/core/bs_set.c b/src/core/bs_set.c index 34d3f66d4..fc939c5c6 100644 --- a/src/core/bs_set.c +++ b/src/core/bs_set.c @@ -15,8 +15,6 @@ #include "module.h" -void myBotServHelp(User * u); - class CommandBSSet : public Command { public: @@ -188,19 +186,11 @@ class BSSet : public Module this->SetVersion("$Id$"); this->SetType(CORE); this->AddCommand(BOTSERV, new CommandBSSet(), MOD_UNIQUE); - - this->SetBotHelp(myBotServHelp); + } + void BotServHelp(User *u) + { + notice_lang(s_BotServ, u, BOT_HELP_CMD_SET); } }; - -/** - * Add the help response to Anopes /bs help output. - * @param u The user who is requesting help - **/ -void myBotServHelp(User * u) -{ - notice_lang(s_BotServ, u, BOT_HELP_CMD_SET); -} - MODULE_INIT("bs_set", BSSet) diff --git a/src/core/bs_unassign.c b/src/core/bs_unassign.c index 01ed984b0..64d6fa269 100644 --- a/src/core/bs_unassign.c +++ b/src/core/bs_unassign.c @@ -16,7 +16,6 @@ #include "module.h" int do_unassign(User * u); -void myBotServHelp(User * u); class CommandBSUnassign : public Command { @@ -66,20 +65,11 @@ class BSUnassign : public Module this->SetVersion("$Id$"); this->SetType(CORE); this->AddCommand(BOTSERV, new CommandBSUnassign, MOD_UNIQUE); - - this->SetBotHelp(myBotServHelp); + } + void BotServHelp(User *u) + { + notice_lang(s_BotServ, u, BOT_HELP_CMD_UNASSIGN); } }; - - -/** - * Add the help response to Anopes /bs help output. - * @param u The user who is requesting help - **/ -void myBotServHelp(User * u) -{ - notice_lang(s_BotServ, u, BOT_HELP_CMD_UNASSIGN); -} - MODULE_INIT("bs_unassign", BSUnassign) diff --git a/src/core/cs_access.c b/src/core/cs_access.c index ced9bf8ba..ac900d7e1 100644 --- a/src/core/cs_access.c +++ b/src/core/cs_access.c @@ -15,20 +15,6 @@ #include "module.h" - -void myChanServHelp(User * u); - -/** - * Add the help response to anopes /cs help output. - * @param u The user who is requesting help - **/ -void myChanServHelp(User * u) -{ - notice_lang(s_ChanServ, u, CHAN_HELP_CMD_ACCESS); - notice_lang(s_ChanServ, u, CHAN_HELP_CMD_LEVELS); -} - - static int access_del(User * u, ChannelInfo *ci, ChanAccess * access, int *perm, int uacc) { char *nick; @@ -513,7 +499,11 @@ class CSAccess : public Module this->AddCommand(CHANSERV, new CommandCSAccess(), MOD_UNIQUE); this->AddCommand(CHANSERV, new CommandCSLevels(), MOD_UNIQUE); - this->SetChanHelp(myChanServHelp); + } + void ChanServHelp(User *u) + { + notice_lang(s_ChanServ, u, CHAN_HELP_CMD_ACCESS); + notice_lang(s_ChanServ, u, CHAN_HELP_CMD_LEVELS); } }; diff --git a/src/core/cs_akick.c b/src/core/cs_akick.c index 524b80fb5..b3b272437 100644 --- a/src/core/cs_akick.c +++ b/src/core/cs_akick.c @@ -15,11 +15,6 @@ #include "module.h" - -void myChanServHelp(User * u); - - - /* Split a usermask up into its constitutent parts. Returned strings are * malloc()'d, and should be free()'d when done with. Returns "*" for * missing parts. @@ -51,16 +46,6 @@ static void split_usermask(const char *mask, const char **nick, const char **use delete [] mask2; } - -/** - * Add the help response to anopes /cs help output. - * @param u The user who is requesting help - **/ -void myChanServHelp(User * u) -{ - notice_lang(s_ChanServ, u, CHAN_HELP_CMD_AKICK); -} - int akick_del(User * u, AutoKick * akick) { if (!(akick->flags & AK_USED)) @@ -688,8 +673,10 @@ class CSAKick : public Module this->SetVersion("$Id$"); this->SetType(CORE); this->AddCommand(CHANSERV, new CommandCSAKick(), MOD_UNIQUE); - - this->SetChanHelp(myChanServHelp); + } + void ChanServHelp(User *u) + { + notice_lang(s_ChanServ, u, CHAN_HELP_CMD_AKICK); } }; diff --git a/src/core/cs_ban.c b/src/core/cs_ban.c index 3ac9f3174..058c2ad6f 100644 --- a/src/core/cs_ban.c +++ b/src/core/cs_ban.c @@ -15,19 +15,6 @@ #include "module.h" -void myChanServHelp(User * u); - - -/** - * Add the help response to anopes /cs help output. - * @param u The user who is requesting help - **/ -void myChanServHelp(User * u) -{ - notice_lang(s_ChanServ, u, CHAN_HELP_CMD_BAN); - notice_lang(s_ChanServ, u, CHAN_HELP_CMD_UNBAN); -} - class CommandCSBan : public Command { public: @@ -188,8 +175,11 @@ class CSBan : public Module this->SetType(CORE); this->AddCommand(CHANSERV, new CommandCSBan(), MOD_UNIQUE); this->AddCommand(CHANSERV, new CommandCSUnban(), MOD_UNIQUE); - - this->SetChanHelp(myChanServHelp); + } + void ChanServHelp(User *u) + { + notice_lang(s_ChanServ, u, CHAN_HELP_CMD_BAN); + notice_lang(s_ChanServ, u, CHAN_HELP_CMD_UNBAN); } }; diff --git a/src/core/cs_clear.c b/src/core/cs_clear.c index aa17b27d0..52505154f 100644 --- a/src/core/cs_clear.c +++ b/src/core/cs_clear.c @@ -15,17 +15,6 @@ #include "module.h" -void myChanServHelp(User * u); - -/** - * Add the help response to anopes /cs help output. - * @param u The user who is requesting help - **/ -void myChanServHelp(User * u) -{ - notice_lang(s_ChanServ, u, CHAN_HELP_CMD_CLEAR); -} - class CommandCSClear : public Command { public: @@ -357,8 +346,10 @@ class CSClear : public Module this->SetVersion("$Id$"); this->SetType(CORE); this->AddCommand(CHANSERV, new CommandCSClear(), MOD_UNIQUE); - - this->SetChanHelp(myChanServHelp); + } + void ChanServHelp(User *u) + { + notice_lang(s_ChanServ, u, CHAN_HELP_CMD_CLEAR); } }; diff --git a/src/core/cs_drop.c b/src/core/cs_drop.c index 81cae5a5a..25f381a37 100644 --- a/src/core/cs_drop.c +++ b/src/core/cs_drop.c @@ -15,18 +15,6 @@ #include "module.h" -void myChanServHelp(User * u); - - -/** - * Add the help response to anopes /cs help output. - * @param u The user who is requesting help - **/ -void myChanServHelp(User * u) -{ - notice_lang(s_ChanServ, u, CHAN_HELP_CMD_DROP); -} - class CommandCSDrop : public Command { public: @@ -133,8 +121,10 @@ class CSDrop : public Module this->SetVersion("$Id$"); this->SetType(CORE); this->AddCommand(CHANSERV, new CommandCSDrop(), MOD_UNIQUE); - - this->SetChanHelp(myChanServHelp); + } + void ChanServHelp(User *u) + { + notice_lang(s_ChanServ, u, CHAN_HELP_CMD_DROP); } }; diff --git a/src/core/cs_forbid.c b/src/core/cs_forbid.c index cf42374b6..dea8ae339 100644 --- a/src/core/cs_forbid.c +++ b/src/core/cs_forbid.c @@ -15,17 +15,6 @@ #include "module.h" -void myChanServHelp(User * u); - -/** - * Add the help response to anopes /cs help output. - * @param u The user who is requesting help - **/ -void myChanServHelp(User * u) -{ - notice_lang(s_ChanServ, u, CHAN_HELP_CMD_FORBID); -} - class CommandCSForbid : public Command { public: @@ -144,8 +133,10 @@ class CSForbid : public Module this->SetVersion("$Id$"); this->SetType(CORE); this->AddCommand(CHANSERV, new CommandCSForbid(), MOD_UNIQUE); - - this->SetChanHelp(myChanServHelp); + } + void ChanServHelp(User *u) + { + notice_lang(s_ChanServ, u, CHAN_HELP_CMD_FORBID); } }; diff --git a/src/core/cs_getkey.c b/src/core/cs_getkey.c index e07850924..cc7e4792f 100644 --- a/src/core/cs_getkey.c +++ b/src/core/cs_getkey.c @@ -15,16 +15,6 @@ #include "module.h" - -/** - * Add the help response to anopes /cs help output. - * @param u The user who is requesting help - **/ -void myChanServHelp(User * u) -{ - notice_lang(s_ChanServ, u, CHAN_HELP_CMD_GETKEY); -} - class CommandCSGetKey : public Command { public: @@ -88,8 +78,10 @@ class CSGetKey : public Module this->SetVersion("$Id$"); this->SetType(CORE); this->AddCommand(CHANSERV, new CommandCSGetKey(), MOD_UNIQUE); - - this->SetChanHelp(myChanServHelp); + } + void ChanServHelp(User *u) + { + notice_lang(s_ChanServ, u, CHAN_HELP_CMD_GETKEY); } }; diff --git a/src/core/cs_getpass.c b/src/core/cs_getpass.c index 130f6217b..5d43d7244 100644 --- a/src/core/cs_getpass.c +++ b/src/core/cs_getpass.c @@ -15,15 +15,6 @@ #include "module.h" -/** - * Add the help response to anopes /cs help output. - * @param u The user who is requesting help - **/ -void myChanServHelp(User * u) -{ - notice_lang(s_ChanServ, u, CHAN_HELP_CMD_GETPASS); -} - class CommandCSGetPass : public Command { public: @@ -86,12 +77,14 @@ class CSGetPass : public Module this->SetType(CORE); this->AddCommand(CHANSERV, new CommandCSGetPass(), MOD_UNIQUE); - this->SetChanHelp(myChanServHelp); - char tmp_pass[PASSMAX]; if (!enc_decrypt("tmp", tmp_pass, PASSMAX - 1)) throw ModuleException("Incompatible with the encryption module being used"); } + void ChanServHelp(User *u) + { + notice_lang(s_ChanServ, u, CHAN_HELP_CMD_GETPASS); + } }; MODULE_INIT("cs_getpass", CSGetPass) diff --git a/src/core/cs_help.c b/src/core/cs_help.c index 3a6d9b5b7..4d7011440 100644 --- a/src/core/cs_help.c +++ b/src/core/cs_help.c @@ -54,7 +54,7 @@ class CommandCSHelp : public Command void OnSyntaxError(User *u) { notice_help(s_ChanServ, u, CHAN_HELP); - moduleDisplayHelp(2, u); + moduleDisplayHelp(s_ChanServ, u); if (CSExpire >= 86400) notice_help(s_ChanServ, u, CHAN_HELP_EXPIRES, CSExpire / 86400); if (u->nc && u->nc->IsServicesOper()) diff --git a/src/core/cs_identify.c b/src/core/cs_identify.c index 59dba5247..ab251eefc 100644 --- a/src/core/cs_identify.c +++ b/src/core/cs_identify.c @@ -15,18 +15,6 @@ #include "module.h" - - - -/** - * Add the help response to anopes /cs help output. - * @param u The user who is requesting help - **/ -void myChanServHelp(User * u) -{ - notice_lang(s_ChanServ, u, CHAN_HELP_CMD_IDENTIFY); -} - class CommandCSIdentify : public Command { public: @@ -118,10 +106,11 @@ class CSIdentify : public Module this->AddCommand(CHANSERV, new CommandCSIdentify("IDENTIFY"), MOD_UNIQUE); // XXX: we need aliases. this->AddCommand(CHANSERV, new CommandCSIdentify("ID"), MOD_UNIQUE); - - this->SetChanHelp(myChanServHelp); + } + void ChanServHelp(User *u) + { + notice_lang(s_ChanServ, u, CHAN_HELP_CMD_IDENTIFY); } }; - MODULE_INIT("cs_identify", CSIdentify) diff --git a/src/core/cs_info.c b/src/core/cs_info.c index 5123858af..c92cb0050 100644 --- a/src/core/cs_info.c +++ b/src/core/cs_info.c @@ -15,17 +15,6 @@ #include "module.h" - -/** - * Add the help response to anopes /cs help output. - * @param u The user who is requesting help - **/ -void myChanServHelp(User * u) -{ - notice_lang(s_ChanServ, u, CHAN_HELP_CMD_INFO); -} - - class CommandCSInfo : public Command { // cannot be const, as it is modified. void CheckOptStr(std::string &buf, int opt, const std::string &str, ChannelInfo *ci, NickCore *nc) @@ -185,8 +174,10 @@ class CSInfo : public Module this->SetVersion("$Id$"); this->SetType(CORE); this->AddCommand(CHANSERV, new CommandCSInfo(), MOD_UNIQUE); - - this->SetChanHelp(myChanServHelp); + } + void ChanServHelp(User *u) + { + notice_lang(s_ChanServ, u, CHAN_HELP_CMD_INFO); } }; diff --git a/src/core/cs_invite.c b/src/core/cs_invite.c index c19823fad..eac5d241c 100644 --- a/src/core/cs_invite.c +++ b/src/core/cs_invite.c @@ -15,16 +15,6 @@ #include "module.h" - -/** - * Add the help response to anopes /cs help output. - * @param u The user who is requesting help - **/ -void myChanServHelp(User * u) -{ - notice_lang(s_ChanServ, u, CHAN_HELP_CMD_INVITE); -} - class CommandCSInvite : public Command { public: @@ -88,8 +78,10 @@ class CSInvite : public Module this->SetVersion("$Id$"); this->SetType(CORE); this->AddCommand(CHANSERV, new CommandCSInvite(), MOD_UNIQUE); - - this->SetChanHelp(myChanServHelp); + } + void ChanServHelp(User *u) + { + notice_lang(s_ChanServ, u, CHAN_HELP_CMD_INVITE); } }; diff --git a/src/core/cs_kick.c b/src/core/cs_kick.c index db53e22aa..c14b0f0a3 100644 --- a/src/core/cs_kick.c +++ b/src/core/cs_kick.c @@ -15,15 +15,6 @@ #include "module.h" -/** - * Add the help response to anopes /cs help output. - * @param u The user who is requesting help - **/ -void myChanServHelp(User * u) -{ - notice_lang(s_ChanServ, u, CHAN_HELP_CMD_KICK); -} - class CommandCSKick : public Command { public: @@ -112,8 +103,10 @@ class CSKick : public Module this->SetVersion("$Id$"); this->SetType(CORE); this->AddCommand(CHANSERV, new CommandCSKick(), MOD_UNIQUE); - - this->SetChanHelp(myChanServHelp); + } + void ChanServHelp(User *u) + { + notice_lang(s_ChanServ, u, CHAN_HELP_CMD_KICK); } }; diff --git a/src/core/cs_list.c b/src/core/cs_list.c index 41b310521..ef1aa4a49 100644 --- a/src/core/cs_list.c +++ b/src/core/cs_list.c @@ -16,19 +16,6 @@ #include "module.h" #include "hashcomp.h" -/** - * Add the help response to anopes /cs help output. - * @param u The user who is requesting help - **/ -void myChanServHelp(User * u) -{ - if (!CSListOpersOnly || (is_oper(u))) - { - notice_lang(s_ChanServ, u, CHAN_HELP_CMD_LIST); - } -} - - class CommandCSList : public Command { public: @@ -198,7 +185,13 @@ public: this->SetVersion("$Id$"); this->SetType(CORE); this->AddCommand(CHANSERV, new CommandCSList(), MOD_UNIQUE); - this->SetChanHelp(myChanServHelp); + } + void ChanServHelp(User *u) + { + if (!CSListOpersOnly || (is_oper(u))) + { + notice_lang(s_ChanServ, u, CHAN_HELP_CMD_LIST); + } } }; diff --git a/src/core/cs_logout.c b/src/core/cs_logout.c index 81a27c451..ba7c8b8e4 100644 --- a/src/core/cs_logout.c +++ b/src/core/cs_logout.c @@ -15,16 +15,6 @@ #include "module.h" -/** - * Add the help response to anopes /cs help output. - * @param u The user who is requesting help - **/ -void myChanServHelp(User * u) -{ - notice_lang(s_ChanServ, u, CHAN_HELP_CMD_LOGOUT); -} - - class CommandCSLogout : public Command { private: @@ -132,8 +122,10 @@ class CSLogout : public Module this->SetVersion("$Id$"); this->SetType(CORE); this->AddCommand(CHANSERV, new CommandCSLogout(), MOD_UNIQUE); - - this->SetChanHelp(myChanServHelp); + } + void ChanServHelp(User *u) + { + notice_lang(s_ChanServ, u, CHAN_HELP_CMD_LOGOUT); } }; diff --git a/src/core/cs_modes.c b/src/core/cs_modes.c index 8aebedcdf..4baf80039 100644 --- a/src/core/cs_modes.c +++ b/src/core/cs_modes.c @@ -15,34 +15,6 @@ #include "module.h" -/** - * Add the help response to anopes /cs help output. - * @param u The user who is requesting help - **/ -void myChanServHelp(User * u) -{ - if (ircd->owner) { - notice_lang(s_ChanServ, u, CHAN_HELP_CMD_OWNER); - notice_lang(s_ChanServ, u, CHAN_HELP_CMD_DEOWNER); - } - if (ircd->protect) { - notice_lang(s_ChanServ, u, CHAN_HELP_CMD_PROTECT); - notice_lang(s_ChanServ, u, CHAN_HELP_CMD_DEPROTECT); - } else if (ircd->admin) { - notice_lang(s_ChanServ, u, CHAN_HELP_CMD_ADMIN); - notice_lang(s_ChanServ, u, CHAN_HELP_CMD_DEADMIN); - } - - notice_lang(s_ChanServ, u, CHAN_HELP_CMD_OP); - notice_lang(s_ChanServ, u, CHAN_HELP_CMD_DEOP); - if (ircd->halfop) { - notice_lang(s_ChanServ, u, CHAN_HELP_CMD_HALFOP); - notice_lang(s_ChanServ, u, CHAN_HELP_CMD_DEHALFOP); - } - notice_lang(s_ChanServ, u, CHAN_HELP_CMD_VOICE); - notice_lang(s_ChanServ, u, CHAN_HELP_CMD_DEVOICE); -} - /* do_util: not a command, but does the job of other */ static CommandReturn do_util(User *u, CSModeUtil *util, const char *chan, const char *nick) @@ -364,8 +336,29 @@ class CSModes : public Module this->AddCommand(CHANSERV, new CommandCSOwner(), MOD_UNIQUE); this->AddCommand(CHANSERV, new CommandCSDeOwner(), MOD_UNIQUE); } + } + void ChanServHelp(User *u) + { + if (ircd->owner) { + notice_lang(s_ChanServ, u, CHAN_HELP_CMD_OWNER); + notice_lang(s_ChanServ, u, CHAN_HELP_CMD_DEOWNER); + } + if (ircd->protect) { + notice_lang(s_ChanServ, u, CHAN_HELP_CMD_PROTECT); + notice_lang(s_ChanServ, u, CHAN_HELP_CMD_DEPROTECT); + } else if (ircd->admin) { + notice_lang(s_ChanServ, u, CHAN_HELP_CMD_ADMIN); + notice_lang(s_ChanServ, u, CHAN_HELP_CMD_DEADMIN); + } - this->SetChanHelp(myChanServHelp); + notice_lang(s_ChanServ, u, CHAN_HELP_CMD_OP); + notice_lang(s_ChanServ, u, CHAN_HELP_CMD_DEOP); + if (ircd->halfop) { + notice_lang(s_ChanServ, u, CHAN_HELP_CMD_HALFOP); + notice_lang(s_ChanServ, u, CHAN_HELP_CMD_DEHALFOP); + } + notice_lang(s_ChanServ, u, CHAN_HELP_CMD_VOICE); + notice_lang(s_ChanServ, u, CHAN_HELP_CMD_DEVOICE); } }; diff --git a/src/core/cs_register.c b/src/core/cs_register.c index 096eb32d3..0d8b38cfd 100644 --- a/src/core/cs_register.c +++ b/src/core/cs_register.c @@ -15,8 +15,6 @@ #include "module.h" -void myChanServHelp(User * u); - class CommandCSRegister : public Command { public: @@ -150,18 +148,11 @@ class CSRegister : public Module this->SetType(CORE); this->AddCommand(CHANSERV, new CommandCSRegister(), MOD_UNIQUE); - - this->SetChanHelp(myChanServHelp); + } + void ChanServHelp(User *u) + { + notice_lang(s_ChanServ, u, CHAN_HELP_CMD_REGISTER); } }; -/** - * Add the help response to anopes /cs help output. - * @param u The user who is requesting help - **/ -void myChanServHelp(User *u) -{ - notice_lang(s_ChanServ, u, CHAN_HELP_CMD_REGISTER); -} - MODULE_INIT("cs_register", CSRegister) diff --git a/src/core/cs_sendpass.c b/src/core/cs_sendpass.c index b6d130cdb..95d723ce5 100644 --- a/src/core/cs_sendpass.c +++ b/src/core/cs_sendpass.c @@ -15,8 +15,6 @@ #include "module.h" -void myChanServHelp(User *u); - class CommandCSSendPass : public Command { public: @@ -97,8 +95,6 @@ class CSSendPass : public Module this->AddCommand(CHANSERV, new CommandCSSendPass(), MOD_UNIQUE); - this->SetChanHelp(myChanServHelp); - if (!UseMail) throw ModuleException("sendpass may not be loaded if UseMail is loaded"); @@ -106,15 +102,10 @@ class CSSendPass : public Module if (!enc_decrypt("tmp", tmp_pass, PASSMAX - 1)) throw ModuleException("Incompatible with the encryption module being used"); } + void ChanServHelp(User *u) + { + notice_lang(s_ChanServ, u, CHAN_HELP_CMD_SENDPASS); + } }; -/** - * Add the help response to anopes /cs help output. - * @param u The user who is requesting help - **/ -void myChanServHelp(User *u) -{ - notice_lang(s_ChanServ, u, CHAN_HELP_CMD_SENDPASS); -} - MODULE_INIT("cs_sendpass", CSSendPass) diff --git a/src/core/cs_set.c b/src/core/cs_set.c index 57f87ca55..6e442d4d1 100644 --- a/src/core/cs_set.c +++ b/src/core/cs_set.c @@ -725,11 +725,6 @@ class CommandCSSet : public Command } }; -void myChanServHelp(User * u) -{ - notice_lang(s_ChanServ, u, CHAN_HELP_CMD_SET); -} - class CSSet : public Module { public: @@ -739,9 +734,11 @@ class CSSet : public Module this->SetVersion("$Id$"); this->SetType(CORE); this->AddCommand(CHANSERV, new CommandCSSet(), MOD_UNIQUE); - this->SetChanHelp(myChanServHelp); + } + void ChanServHelp(User *u) + { + notice_lang(s_ChanServ, u, CHAN_HELP_CMD_SET); } }; - MODULE_INIT("cs_set", CSSet) diff --git a/src/core/cs_status.c b/src/core/cs_status.c index 1bca1483f..5af819563 100644 --- a/src/core/cs_status.c +++ b/src/core/cs_status.c @@ -15,8 +15,6 @@ #include "module.h" -void myChanServHelp(User *u); - class CommandCSStatus : public Command { public: @@ -73,18 +71,11 @@ class CSStatus : public Module this->SetType(CORE); this->AddCommand(CHANSERV, new CommandCSStatus(), MOD_UNIQUE); - - this->SetChanHelp(myChanServHelp); + } + void ChanServHelp(User *u) + { + notice_lang(s_ChanServ, u, CHAN_HELP_CMD_STATUS); } }; -/** - * Add the help response to anopes /cs help output. - * @param u The user who is requesting help - **/ -void myChanServHelp(User *u) -{ - notice_lang(s_ChanServ, u, CHAN_HELP_CMD_STATUS); -} - MODULE_INIT("cs_status", CSStatus) diff --git a/src/core/cs_suspend.c b/src/core/cs_suspend.c index 161471382..cd6cb99e1 100644 --- a/src/core/cs_suspend.c +++ b/src/core/cs_suspend.c @@ -15,8 +15,6 @@ #include "module.h" -void myChanServHelp(User *u); - class CommandCSSuspend : public Command { public: @@ -208,19 +206,12 @@ class CSSuspend : public Module this->AddCommand(CHANSERV, new CommandCSSuspend(), MOD_UNIQUE); this->AddCommand(CHANSERV, new CommandCSUnSuspend(), MOD_UNIQUE); - - this->SetChanHelp(myChanServHelp); + } + void ChanServHelp(User *u) + { + notice_lang(s_ChanServ, u, CHAN_HELP_CMD_SUSPEND); + notice_lang(s_ChanServ, u, CHAN_HELP_CMD_UNSUSPEND); } }; -/** - * Add the help response to anopes /cs help output. - * @param u The user who is requesting help - **/ -void myChanServHelp(User *u) -{ - notice_lang(s_ChanServ, u, CHAN_HELP_CMD_SUSPEND); - notice_lang(s_ChanServ, u, CHAN_HELP_CMD_UNSUSPEND); -} - MODULE_INIT("cs_suspend", CSSuspend) diff --git a/src/core/cs_topic.c b/src/core/cs_topic.c index 54a49ab59..5d603bae7 100644 --- a/src/core/cs_topic.c +++ b/src/core/cs_topic.c @@ -15,8 +15,6 @@ #include "module.h" -void myChanServHelp(User *u); - class CommandCSTopic : public Command { public: @@ -91,18 +89,11 @@ class CSTopic : public Module this->SetType(CORE); this->AddCommand(CHANSERV, new CommandCSTopic(), MOD_UNIQUE); - - this->SetChanHelp(myChanServHelp); + } + void ChanServHelp(User *u) + { + notice_lang(s_ChanServ, u, CHAN_HELP_CMD_TOPIC); } }; -/** - * Add the help response to anopes /cs help output. - * @param u The user who is requesting help - **/ -void myChanServHelp(User *u) -{ - notice_lang(s_ChanServ, u, CHAN_HELP_CMD_TOPIC); -} - MODULE_INIT("cs_topic", CSTopic) diff --git a/src/core/cs_xop.c b/src/core/cs_xop.c index 6cf790851..fa63f60e9 100644 --- a/src/core/cs_xop.c +++ b/src/core/cs_xop.c @@ -18,7 +18,6 @@ int xop_del_callback(User *u, int num, va_list args); int xop_list_callback(User *u, int num, va_list args); int xop_list(User *u, int index, ChannelInfo *ci, int *sent_header, int xlev, int xmsg); -void myChanServHelp(User *u); enum { @@ -506,24 +505,17 @@ class CSXOP : public Module this->AddCommand(CHANSERV, new CommandCSHOP(), MOD_UNIQUE); this->AddCommand(CHANSERV, new CommandCSSOP(), MOD_UNIQUE); this->AddCommand(CHANSERV, new CommandCSVOP(), MOD_UNIQUE); - - this->SetChanHelp(myChanServHelp); + } + void ChanServHelp(User *u) + { + notice_lang(s_ChanServ, u, CHAN_HELP_CMD_SOP); + notice_lang(s_ChanServ, u, CHAN_HELP_CMD_AOP); + if (ircd->halfop) + notice_lang(s_ChanServ, u, CHAN_HELP_CMD_HOP); + notice_lang(s_ChanServ, u, CHAN_HELP_CMD_VOP); } }; -/** - * Add the help response to anopes /cs help output. - * @param u The user who is requesting help - **/ -void myChanServHelp(User *u) -{ - notice_lang(s_ChanServ, u, CHAN_HELP_CMD_SOP); - notice_lang(s_ChanServ, u, CHAN_HELP_CMD_AOP); - if (ircd->halfop) - notice_lang(s_ChanServ, u, CHAN_HELP_CMD_HOP); - notice_lang(s_ChanServ, u, CHAN_HELP_CMD_VOP); -} - /* `last' is set to the last index this routine was called with * `perm' is incremented whenever a permission-denied error occurs */ diff --git a/src/core/hs_del.c b/src/core/hs_del.c index c0d0ae40c..d86c87f41 100644 --- a/src/core/hs_del.c +++ b/src/core/hs_del.c @@ -15,8 +15,6 @@ #include "module.h" -void myHostServHelp(User *u); - class CommandHSDel : public Command { public: @@ -72,18 +70,11 @@ class HSDel : public Module this->SetType(CORE); this->AddCommand(HOSTSERV, new CommandHSDel(), MOD_UNIQUE); - - this->SetHostHelp(myHostServHelp); + } + void HostServHelp(User *u) + { + notice_lang(s_HostServ, u, HOST_HELP_CMD_DEL); } }; -/** - * Add the help response to anopes /hs help output. - * @param u The user who is requesting help - **/ -void myHostServHelp(User *u) -{ - notice_lang(s_HostServ, u, HOST_HELP_CMD_DEL); -} - MODULE_INIT("hs_del", HSDel) diff --git a/src/core/hs_delall.c b/src/core/hs_delall.c index 4de865ebe..8ffb4a059 100644 --- a/src/core/hs_delall.c +++ b/src/core/hs_delall.c @@ -15,8 +15,6 @@ #include "module.h" -void myHostServHelp(User *u); - class CommandHSDelAll : public Command { public: @@ -79,18 +77,11 @@ class HSDelAll : public Module this->SetType(CORE); this->AddCommand(HOSTSERV, new CommandHSDelAll(), MOD_UNIQUE); - - this->SetHostHelp(myHostServHelp); + } + void HostServHelp(User *u) + { + notice_lang(s_HostServ, u, HOST_HELP_CMD_DELALL); } }; -/** - * Add the help response to anopes /hs help output. - * @param u The user who is requesting help - **/ -void myHostServHelp(User *u) -{ - notice_lang(s_HostServ, u, HOST_HELP_CMD_DELALL); -} - MODULE_INIT("hs_delall", HSDelAll) diff --git a/src/core/hs_group.c b/src/core/hs_group.c index 3379c2a1a..573f1be66 100644 --- a/src/core/hs_group.c +++ b/src/core/hs_group.c @@ -15,7 +15,6 @@ #include "module.h" -void myHostServHelp(User *u); extern int do_hs_sync(NickCore *nc, char *vIdent, char *hostmask, char *creator, time_t time); class CommandHSGroup : public Command @@ -94,18 +93,11 @@ class HSGroup : public Module this->SetType(CORE); this->AddCommand(HOSTSERV, new CommandHSGroup(), MOD_UNIQUE); - - this->SetHostHelp(myHostServHelp); + } + void HostServHelp(User *u) + { + notice_lang(s_HostServ, u, HOST_HELP_CMD_GROUP); } }; -/** - * Add the help response to anopes /hs help output. - * @param u The user who is requesting help - **/ -void myHostServHelp(User *u) -{ - notice_lang(s_HostServ, u, HOST_HELP_CMD_GROUP); -} - MODULE_INIT("hs_group", HSGroup) diff --git a/src/core/hs_help.c b/src/core/hs_help.c index 86c12223d..ca1f689ae 100644 --- a/src/core/hs_help.c +++ b/src/core/hs_help.c @@ -32,7 +32,7 @@ class CommandHSHelp : public Command void OnSyntaxError(User *u) { notice_help(s_HostServ, u, HOST_HELP, s_HostServ); - moduleDisplayHelp(6, u); + moduleDisplayHelp(s_HostServ, u); } }; diff --git a/src/core/hs_list.c b/src/core/hs_list.c index ec678df7a..c12ef5907 100644 --- a/src/core/hs_list.c +++ b/src/core/hs_list.c @@ -15,8 +15,6 @@ #include "module.h" -void myHostServHelp(User *u); - class CommandHSList : public Command { public: @@ -154,17 +152,11 @@ class HSList : public Module this->SetType(CORE); this->AddCommand(HOSTSERV, new CommandHSList(), MOD_UNIQUE); - this->SetHostHelp(myHostServHelp); + } + void HostServHelp(User *u) + { + notice_lang(s_HostServ, u, HOST_HELP_CMD_LIST); } }; -/** - * Add the help response to anopes /hs help output. - * @param u The user who is requesting help - **/ -void myHostServHelp(User *u) -{ - notice_lang(s_HostServ, u, HOST_HELP_CMD_LIST); -} - MODULE_INIT("hs_list", HSList) diff --git a/src/core/hs_off.c b/src/core/hs_off.c index f44b0e5a9..18bf25857 100644 --- a/src/core/hs_off.c +++ b/src/core/hs_off.c @@ -15,8 +15,6 @@ #include "module.h" -void myHostServHelp(User *u); - class CommandHSOff : public Command { public: @@ -65,18 +63,11 @@ class HSOff : public Module this->SetType(CORE); this->AddCommand(HOSTSERV, new CommandHSOff(), MOD_UNIQUE); - - this->SetHostHelp(myHostServHelp); + } + void HostServHelp(User *u) + { + notice_lang(s_HostServ, u, HOST_HELP_CMD_OFF); } }; -/** - * Add the help response to anopes /hs help output. - * @param u The user who is requesting help - **/ -void myHostServHelp(User *u) -{ - notice_lang(s_HostServ, u, HOST_HELP_CMD_OFF); -} - MODULE_INIT("hs_off", HSOff) diff --git a/src/core/hs_on.c b/src/core/hs_on.c index 9286023b2..8255150da 100644 --- a/src/core/hs_on.c +++ b/src/core/hs_on.c @@ -15,8 +15,6 @@ #include "module.h" -void myHostServHelp(User *u); - class CommandHSOn : public Command { public: @@ -79,18 +77,11 @@ class HSOn : public Module this->SetType(CORE); this->AddCommand(HOSTSERV, new CommandHSOn(), MOD_UNIQUE); - - this->SetHostHelp(myHostServHelp); + } + void HostServHelp(User *u) + { + notice_lang(s_HostServ, u, HOST_HELP_CMD_ON); } }; -/** - * Add the help response to anopes /hs help output. - * @param u The user who is requesting help - **/ -void myHostServHelp(User *u) -{ - notice_lang(s_HostServ, u, HOST_HELP_CMD_ON); -} - MODULE_INIT("hs_on", HSOn) diff --git a/src/core/hs_set.c b/src/core/hs_set.c index a117f7540..062c758cf 100644 --- a/src/core/hs_set.c +++ b/src/core/hs_set.c @@ -15,8 +15,6 @@ #include "module.h" -void myHostServHelp(User *u); - class CommandHSSet : public Command { public: @@ -169,18 +167,11 @@ class HSSet : public Module this->SetType(CORE); this->AddCommand(HOSTSERV, new CommandHSSet(), MOD_UNIQUE); - - this->SetHostHelp(myHostServHelp); + } + void HostServHelp(User *u) + { + notice_lang(s_HostServ, u, HOST_HELP_CMD_SET); } }; -/** - * Add the help response to anopes /hs help output. - * @param u The user who is requesting help - **/ -void myHostServHelp(User *u) -{ - notice_lang(s_HostServ, u, HOST_HELP_CMD_SET); -} - MODULE_INIT("hs_set", HSSet) diff --git a/src/core/hs_setall.c b/src/core/hs_setall.c index 1177ca5d8..05707c39a 100644 --- a/src/core/hs_setall.c +++ b/src/core/hs_setall.c @@ -15,7 +15,6 @@ #include "module.h" -void myHostServHelp(User *u); extern int do_hs_sync(NickCore *nc, char *vIdent, char *hostmask, char *creator, time_t time); class CommandHSSetAll : public Command @@ -169,17 +168,11 @@ class HSSetAll : public Module this->SetType(CORE); this->AddCommand(HOSTSERV, new CommandHSSetAll(), MOD_UNIQUE); - this->SetHostHelp(myHostServHelp); + } + void HostServHelp(User *u) + { + notice_lang(s_HostServ, u, HOST_HELP_CMD_SETALL); } }; -/** - * Add the help response to anopes /hs help output. - * @param u The user who is requesting help - **/ -void myHostServHelp(User *u) -{ - notice_lang(s_HostServ, u, HOST_HELP_CMD_SETALL); -} - MODULE_INIT("hs_setall", HSSetAll) diff --git a/src/core/ms_cancel.c b/src/core/ms_cancel.c index 48867563e..0991303dc 100644 --- a/src/core/ms_cancel.c +++ b/src/core/ms_cancel.c @@ -80,17 +80,11 @@ class MSCancel : public Module this->SetVersion("$Id$"); this->SetType(CORE); this->AddCommand(MEMOSERV, new CommandMSCancel(), MOD_UNIQUE); - this->SetMemoHelp(myMemoServHelp); + } + void MemoServHelp(User *u) + { + notice_lang(s_MemoServ, u, MEMO_HELP_CMD_CANCEL); } }; -/** - * Add the help response to anopes /ms help output. - * @param u The user who is requesting help - **/ -void myMemoServHelp(User *u) -{ - notice_lang(s_MemoServ, u, MEMO_HELP_CMD_CANCEL); -} - MODULE_INIT("ms_cancel", MSCancel) diff --git a/src/core/ms_check.c b/src/core/ms_check.c index 19f376873..cfb331709 100644 --- a/src/core/ms_check.c +++ b/src/core/ms_check.c @@ -15,8 +15,6 @@ #include "module.h" -void myMemoServHelp(User *u); - class CommandMSCheck : public Command { public: @@ -99,17 +97,11 @@ class MSCheck : public Module this->SetVersion("$Id$"); this->SetType(CORE); this->AddCommand(MEMOSERV, new CommandMSCheck(), MOD_UNIQUE); - this->SetMemoHelp(myMemoServHelp); + } + void MemoServHelp(User *u) + { + notice_lang(s_MemoServ, u, MEMO_HELP_CMD_CHECK); } }; -/** - * Add the help response to anopes /ms help output. - * @param u The user who is requesting help - **/ -void myMemoServHelp(User *u) -{ - notice_lang(s_MemoServ, u, MEMO_HELP_CMD_CHECK); -} - MODULE_INIT("ms_check", MSCheck) diff --git a/src/core/ms_del.c b/src/core/ms_del.c index d3eea944a..a8c5bccd1 100644 --- a/src/core/ms_del.c +++ b/src/core/ms_del.c @@ -16,7 +16,6 @@ #include "module.h" int del_memo_callback(User *u, int num, va_list args); -void myMemoServHelp(User *u); class CommandMSDel : public Command { @@ -158,19 +157,13 @@ class MSDel : public Module this->SetVersion("$Id$"); this->SetType(CORE); this->AddCommand(MEMOSERV, new CommandMSDel(), MOD_UNIQUE); - this->SetMemoHelp(myMemoServHelp); + } + void MemoServHelp(User *u) + { + notice_lang(s_MemoServ, u, MEMO_HELP_CMD_DEL); } }; -/** - * Add the help response to anopes /ms help output. - * @param u The user who is requesting help - **/ -void myMemoServHelp(User *u) -{ - notice_lang(s_MemoServ, u, MEMO_HELP_CMD_DEL); -} - /** * Delete a single memo from a MemoInfo. callback function * @param u User Struct diff --git a/src/core/ms_help.c b/src/core/ms_help.c index 20471a1c4..382f571dc 100644 --- a/src/core/ms_help.c +++ b/src/core/ms_help.c @@ -32,7 +32,7 @@ class CommandMSHelp : public Command void OnSyntaxError(User *u) { notice_help(s_MemoServ, u, MEMO_HELP_HEADER); - moduleDisplayHelp(3, u); + moduleDisplayHelp(s_MemoServ, u); notice_help(s_MemoServ, u, MEMO_HELP_FOOTER, s_ChanServ); } }; diff --git a/src/core/ms_info.c b/src/core/ms_info.c index 41bfffd61..9d87b019f 100644 --- a/src/core/ms_info.c +++ b/src/core/ms_info.c @@ -15,8 +15,6 @@ #include "module.h" -void myMemoServHelp(User *u); - class CommandMSInfo : public Command { public: @@ -218,17 +216,11 @@ class MSInfo : public Module this->SetVersion("$Id$"); this->SetType(CORE); this->AddCommand(MEMOSERV, new CommandMSInfo(), MOD_UNIQUE); - this->SetMemoHelp(myMemoServHelp); + } + void MemoServHelp(User *u) + { + notice_lang(s_MemoServ, u, MEMO_HELP_CMD_INFO); } }; -/** - * Add the help response to anopes /ms help output. - * @param u The user who is requesting help - **/ -void myMemoServHelp(User *u) -{ - notice_lang(s_MemoServ, u, MEMO_HELP_CMD_INFO); -} - MODULE_INIT("ms_info", MSInfo) diff --git a/src/core/ms_list.c b/src/core/ms_list.c index 85cd21047..4ade2fd5e 100644 --- a/src/core/ms_list.c +++ b/src/core/ms_list.c @@ -17,7 +17,6 @@ int list_memo_callback(User *u, int num, va_list args); int list_memo(User *u, int index, MemoInfo *mi, int *sent_header, int newi, const char *chan); -void myMemoServHelp(User *u); class CommandMSList : public Command { @@ -124,19 +123,13 @@ class MSList : public Module this->SetVersion("$Id$"); this->SetType(CORE); this->AddCommand(MEMOSERV, new CommandMSList(), MOD_UNIQUE); - this->SetMemoHelp(myMemoServHelp); + } + void MemoServHelp(User *u) + { + notice_lang(s_MemoServ, u, MEMO_HELP_CMD_LIST); } }; -/** - * Add the help response to anopes /ms help output. - * @param u The user who is requesting help - **/ -void myMemoServHelp(User *u) -{ - notice_lang(s_MemoServ, u, MEMO_HELP_CMD_LIST); -} - /** * list memno callback function * @param u User Struct diff --git a/src/core/ms_read.c b/src/core/ms_read.c index 15c968b94..fe5a959eb 100644 --- a/src/core/ms_read.c +++ b/src/core/ms_read.c @@ -17,7 +17,6 @@ int read_memo_callback(User *u, int num, va_list args); int read_memo(User *u, int index, MemoInfo *mi, const char *chan); -void myMemoServHelp(User *u); extern void rsend_notify(User *u, Memo *m, const char *chan); class CommandMSRead : public Command @@ -131,19 +130,13 @@ class MSRead : public Module this->SetVersion("$Id$"); this->SetType(CORE); this->AddCommand(MEMOSERV, new CommandMSRead(), MOD_UNIQUE); - this->SetMemoHelp(myMemoServHelp); + } + void MemoServHelp(User *u) + { + notice_lang(s_MemoServ, u, MEMO_HELP_CMD_READ); } }; -/** - * Add the help response to anopes /ms help output. - * @param u The user who is requesting help - **/ -void myMemoServHelp(User *u) -{ - notice_lang(s_MemoServ, u, MEMO_HELP_CMD_READ); -} - /** * Read a memo callback function * @param u User Struct diff --git a/src/core/ms_rsend.c b/src/core/ms_rsend.c index 80950c9eb..999a2f4bd 100644 --- a/src/core/ms_rsend.c +++ b/src/core/ms_rsend.c @@ -15,8 +15,6 @@ #include "module.h" -void myMemoServHelp(User *u); - class CommandMSRSend : public Command { public: @@ -89,20 +87,14 @@ class MSRSend : public Module this->SetVersion("$Id$"); this->SetType(CORE); this->AddCommand(MEMOSERV, new CommandMSRSend(), MOD_UNIQUE); - this->SetMemoHelp(myMemoServHelp); if (!MSMemoReceipt) throw ModuleException("Don't like memo reciepts, or something."); } + void MemoServHelp(User *u) + { + notice_lang(s_MemoServ, u, MEMO_HELP_CMD_RSEND); + } }; -/** - * Add the help response to anopes /ms help output. - * @param u The user who is requesting help - **/ -void myMemoServHelp(User *u) -{ - notice_lang(s_MemoServ, u, MEMO_HELP_CMD_RSEND); -} - MODULE_INIT("ms_rsend", MSRSend) diff --git a/src/core/ms_send.c b/src/core/ms_send.c index fcc0bdf0b..9c9db1c7a 100644 --- a/src/core/ms_send.c +++ b/src/core/ms_send.c @@ -15,8 +15,6 @@ #include "module.h" -void myMemoServHelp(User *u); - class CommandMSSend : public Command { public: @@ -54,17 +52,11 @@ class MSSend : public Module this->SetVersion("$Id$"); this->SetType(CORE); this->AddCommand(MEMOSERV, new CommandMSSend(), MOD_UNIQUE); - this->SetMemoHelp(myMemoServHelp); + } + void MemoServHelp(User *u) + { + notice_lang(s_MemoServ, u, MEMO_HELP_CMD_SEND); } }; -/** - * Add the help response to anopes /ms help output. - * @param u The user who is requesting help - **/ -void myMemoServHelp(User *u) -{ - notice_lang(s_MemoServ, u, MEMO_HELP_CMD_SEND); -} - MODULE_INIT("ms_send", MSSend) diff --git a/src/core/ms_sendall.c b/src/core/ms_sendall.c index bdfa89045..aa1eee790 100644 --- a/src/core/ms_sendall.c +++ b/src/core/ms_sendall.c @@ -15,8 +15,6 @@ #include "module.h" -void myMemoServHelp(User *u); - class CommandMSSendAll : public Command { public: @@ -81,17 +79,11 @@ class MSSendAll : public Module this->SetVersion("$Id$"); this->SetType(CORE); this->AddCommand(MEMOSERV, new CommandMSSendAll(), MOD_UNIQUE); - this->SetMemoHelp(myMemoServHelp); + } + void MemoServHelp(User *u) + { + notice_lang(s_MemoServ, u, MEMO_HELP_CMD_SENDALL); } }; -/** - * Add the help response to anopes /ms help output. - * @param u The user who is requesting help - **/ -void myMemoServHelp(User *u) -{ - notice_lang(s_MemoServ, u, MEMO_HELP_CMD_SENDALL); -} - MODULE_INIT("ms_sendall", MSSendAll) diff --git a/src/core/ms_set.c b/src/core/ms_set.c index a9922aae8..4d96b355e 100644 --- a/src/core/ms_set.c +++ b/src/core/ms_set.c @@ -15,8 +15,6 @@ #include "module.h" -void myMemoServHelp(User *u); - class CommandMSSet : public Command { private: @@ -266,18 +264,11 @@ class MSSet : public Module this->SetType(CORE); this->AddCommand(MEMOSERV, new CommandMSSet(), MOD_UNIQUE); - - this->SetMemoHelp(myMemoServHelp); + } + void MemoServHelp(User *u) + { + notice_lang(s_MemoServ, u, MEMO_HELP_CMD_SET); } }; -/** - * Add the help response to anopes /hs help output. - * @param u The user who is requesting help - **/ -void myMemoServHelp(User *u) -{ - notice_lang(s_MemoServ, u, MEMO_HELP_CMD_SET); -} - MODULE_INIT("ms_set", MSSet) diff --git a/src/core/ms_staff.c b/src/core/ms_staff.c index 45bcc6ca0..7d4ca6665 100644 --- a/src/core/ms_staff.c +++ b/src/core/ms_staff.c @@ -15,8 +15,6 @@ #include "module.h" -void myMemoServHelp(User *u); - class CommandMSStaff : public Command { public: @@ -79,17 +77,11 @@ class MSStaff : public Module this->SetVersion("$Id$"); this->SetType(CORE); this->AddCommand(MEMOSERV, new CommandMSStaff(), MOD_UNIQUE); - this->SetMemoHelp(myMemoServHelp); + } + void MemoServHelp(User *u) + { + notice_lang(s_MemoServ, u, MEMO_HELP_CMD_STAFF); } }; -/** - * Add the help response to anopes /ms help output. - * @param u The user who is requesting help - **/ -void myMemoServHelp(User *u) -{ - notice_lang(s_MemoServ, u, MEMO_HELP_CMD_STAFF); -} - MODULE_INIT("ms_staff", MSStaff) diff --git a/src/core/ns_access.c b/src/core/ns_access.c index e66cce40e..4222a47b4 100644 --- a/src/core/ns_access.c +++ b/src/core/ns_access.c @@ -15,8 +15,6 @@ #include "module.h" -void myNickServHelp(User *u); - class CommandNSAccess : public Command { private: @@ -183,18 +181,11 @@ class NSAccess : public Module this->SetType(CORE); this->AddCommand(NICKSERV, new CommandNSAccess(), MOD_UNIQUE); - - this->SetNickHelp(myNickServHelp); + } + void NickServHelp(User *u) + { + notice_lang(s_NickServ, u, NICK_HELP_CMD_ACCESS); } }; -/** - * Add the help response to anopes /ns help output. - * @param u The user who is requesting help - **/ -void myNickServHelp(User *u) -{ - notice_lang(s_NickServ, u, NICK_HELP_CMD_ACCESS); -} - MODULE_INIT("ns_access", NSAccess) diff --git a/src/core/ns_alist.c b/src/core/ns_alist.c index 99d72668a..21cbdd99a 100644 --- a/src/core/ns_alist.c +++ b/src/core/ns_alist.c @@ -15,8 +15,6 @@ #include "module.h" -void myNickServHelp(User *u); - class CommandNSAList : public Command { public: @@ -153,18 +151,11 @@ class NSAList : public Module this->SetType(CORE); this->AddCommand(NICKSERV, new CommandNSAList(), MOD_UNIQUE); - - this->SetNickHelp(myNickServHelp); + } + void NickServHelp(User *u) + { + notice_lang(s_NickServ, u, NICK_HELP_CMD_ALIST); } }; -/** - * Add the help response to anopes /ns help output. - * @param u The user who is requesting help - **/ -void myNickServHelp(User *u) -{ - notice_lang(s_NickServ, u, NICK_HELP_CMD_ALIST); -} - MODULE_INIT("ns_alist", NSAList) diff --git a/src/core/ns_drop.c b/src/core/ns_drop.c index cbffd0f0f..b67e079ff 100644 --- a/src/core/ns_drop.c +++ b/src/core/ns_drop.c @@ -15,8 +15,6 @@ #include "module.h" -void myNickServHelp(User *u); - class CommandNSDrop : public Command { public: @@ -120,18 +118,11 @@ class NSDrop : public Module this->SetType(CORE); this->AddCommand(NICKSERV, new CommandNSDrop(), MOD_UNIQUE); - - this->SetNickHelp(myNickServHelp); + } + void NickServHelp(User *u) + { + notice_lang(s_NickServ, u, NICK_HELP_CMD_DROP); } }; -/** - * Add the help response to anopes /ns help output. - * @param u The user who is requesting help - **/ -void myNickServHelp(User *u) -{ - notice_lang(s_NickServ, u, NICK_HELP_CMD_DROP); -} - MODULE_INIT("ns_drop", NSDrop) diff --git a/src/core/ns_forbid.c b/src/core/ns_forbid.c index a1b9ed873..bf7a6298b 100644 --- a/src/core/ns_forbid.c +++ b/src/core/ns_forbid.c @@ -15,7 +15,6 @@ #include "module.h" -void myNickServHelp(User *u); NickAlias *makenick(const char *nick); class CommandNSForbid : public Command @@ -110,20 +109,13 @@ class NSForbid : public Module this->SetType(CORE); this->AddCommand(NICKSERV, new CommandNSForbid(), MOD_UNIQUE); - - this->SetNickHelp(myNickServHelp); + } + void NickServHelp(User *u) + { + notice_lang(s_NickServ, u, NICK_HELP_CMD_FORBID); } }; -/** - * Add the help response to anopes /ns help output. - * @param u The user who is requesting help - **/ -void myNickServHelp(User *u) -{ - notice_lang(s_NickServ, u, NICK_HELP_CMD_FORBID); -} - NickAlias *makenick(const char *nick) { NickAlias *na; diff --git a/src/core/ns_getemail.c b/src/core/ns_getemail.c index f80bb1806..6baaadcd3 100644 --- a/src/core/ns_getemail.c +++ b/src/core/ns_getemail.c @@ -20,8 +20,6 @@ #include "module.h" -void myNickServHelp(User *u); - class CommandNSGetEMail : public Command { public: @@ -80,18 +78,11 @@ class NSGetEMail : public Module this->SetType(CORE); this->AddCommand(NICKSERV, new CommandNSGetEMail(), MOD_UNIQUE); - - this->SetNickHelp(myNickServHelp); + } + void NickServHelp(User *u) + { + notice_lang(s_NickServ, u, NICK_HELP_CMD_GETEMAIL); } }; -/** - * Add the help response to anopes /ns help output. - * @param u The user who is requesting help - **/ -void myNickServHelp(User *u) -{ - notice_lang(s_NickServ, u, NICK_HELP_CMD_GETEMAIL); -} - MODULE_INIT("ns_getemail", NSGetEMail) diff --git a/src/core/ns_getpass.c b/src/core/ns_getpass.c index bb395ab8c..04d7b1ba0 100644 --- a/src/core/ns_getpass.c +++ b/src/core/ns_getpass.c @@ -15,8 +15,6 @@ #include "module.h" -void myNickServHelp(User *u); - class CommandNSGetPass : public Command { public: @@ -91,21 +89,14 @@ class NSGetPass : public Module this->AddCommand(NICKSERV, new CommandNSGetPass(), MOD_UNIQUE); - this->SetNickHelp(myNickServHelp); - char tmp_pass[PASSMAX]; if (!enc_decrypt("tmp", tmp_pass, PASSMAX - 1)) throw ModuleException("Incompatible with the encryption module being used"); } + void NickServHelp(User *u) + { + notice_lang(s_NickServ, u, NICK_HELP_CMD_GETPASS); + } }; -/** - * Add the help response to anopes /ns help output. - * @param u The user who is requesting help - **/ -void myNickServHelp(User *u) -{ - notice_lang(s_NickServ, u, NICK_HELP_CMD_GETPASS); -} - MODULE_INIT("ns_getpass", NSGetPass) diff --git a/src/core/ns_ghost.c b/src/core/ns_ghost.c index ffca53cb4..35d6f1a67 100644 --- a/src/core/ns_ghost.c +++ b/src/core/ns_ghost.c @@ -15,8 +15,6 @@ #include "module.h" -void myNickServHelp(User *u); - class CommandNSGhost : public Command { public: @@ -98,18 +96,11 @@ class NSGhost : public Module this->SetType(CORE); this->AddCommand(NICKSERV, new CommandNSGhost(), MOD_UNIQUE); - - this->SetNickHelp(myNickServHelp); + } + void NickServHelp(User *u) + { + notice_lang(s_NickServ, u, NICK_HELP_CMD_GHOST); } }; -/** - * Add the help response to anopes /ns help output. - * @param u The user who is requesting help - **/ -void myNickServHelp(User *u) -{ - notice_lang(s_NickServ, u, NICK_HELP_CMD_GHOST); -} - MODULE_INIT("ns_ghost", NSGhost) diff --git a/src/core/ns_group.c b/src/core/ns_group.c index bac000611..47b67960c 100644 --- a/src/core/ns_group.c +++ b/src/core/ns_group.c @@ -15,8 +15,6 @@ #include "module.h" -void myNickServHelp(User *u); - NickAlias *makealias(const char *nick, NickCore *nc); class CommandNSGroup : public Command @@ -267,21 +265,14 @@ class NSGroup : public Module this->AddCommand(NICKSERV, new CommandNSGroup(), MOD_UNIQUE); this->AddCommand(NICKSERV, new CommandNSGList(), MOD_UNIQUE); - - this->SetNickHelp(myNickServHelp); + } + void NickServHelp(User *u) + { + notice_lang(s_NickServ, u, NICK_HELP_CMD_GROUP); + notice_lang(s_NickServ, u, NICK_HELP_CMD_GLIST); } }; -/** - * Add the help response to anopes /ns help output. - * @param u The user who is requesting help - **/ -void myNickServHelp(User *u) -{ - notice_lang(s_NickServ, u, NICK_HELP_CMD_GROUP); - notice_lang(s_NickServ, u, NICK_HELP_CMD_GLIST); -} - /* Creates a new alias in NickServ database. */ NickAlias *makealias(const char *nick, NickCore *nc) { diff --git a/src/core/ns_help.c b/src/core/ns_help.c index 5c2b164cd..046af753f 100644 --- a/src/core/ns_help.c +++ b/src/core/ns_help.c @@ -43,7 +43,7 @@ class CommandNSHelp : public Command void OnSyntaxError(User *u) { notice_help(s_NickServ, u, NICK_HELP); - moduleDisplayHelp(1, u); + moduleDisplayHelp(s_NickServ, u); if (u->nc && u->nc->IsServicesOper()) notice_help(s_NickServ, u, NICK_SERVADMIN_HELP); if (NSExpire >= 86400) diff --git a/src/core/ns_identify.c b/src/core/ns_identify.c index d09be6a03..457edb974 100644 --- a/src/core/ns_identify.c +++ b/src/core/ns_identify.c @@ -18,8 +18,6 @@ #define TO_COLLIDE 0 /* Collide the user with this nick */ #define TO_RELEASE 1 /* Release a collided nick */ -void myNickServHelp(User *u); - class CommandNSIdentify : public Command { public: @@ -135,18 +133,11 @@ class NSIdentify : public Module this->AddCommand(NICKSERV, new CommandNSIdentify("IDENTIFY"), MOD_UNIQUE); this->AddCommand(NICKSERV, new CommandNSIdentify("ID"), MOD_UNIQUE); - - this->SetNickHelp(myNickServHelp); + } + void NickServHelp(User *u) + { + notice_lang(s_NickServ, u, NICK_HELP_CMD_IDENTIFY); } }; -/** - * Add the help response to anopes /ns help output. - * @param u The user who is requesting help - **/ -void myNickServHelp(User *u) -{ - notice_lang(s_NickServ, u, NICK_HELP_CMD_IDENTIFY); -} - MODULE_INIT("ns_identify", NSIdentify) diff --git a/src/core/ns_info.c b/src/core/ns_info.c index d537ff272..330743438 100644 --- a/src/core/ns_info.c +++ b/src/core/ns_info.c @@ -15,8 +15,6 @@ #include "module.h" -void myNickServHelp(User *u); - class CommandNSInfo : public Command { private: @@ -220,18 +218,11 @@ class NSInfo : public Module this->SetType(CORE); this->AddCommand(NICKSERV, new CommandNSInfo(), MOD_UNIQUE); - - this->SetNickHelp(myNickServHelp); + } + void NickServHelp(User *u) + { + notice_lang(s_NickServ, u, NICK_HELP_CMD_INFO); } }; -/** - * Add the help response to anopes /ns help output. - * @param u The user who is requesting help - **/ -void myNickServHelp(User *u) -{ - notice_lang(s_NickServ, u, NICK_HELP_CMD_INFO); -} - MODULE_INIT("ns_info", NSInfo) diff --git a/src/core/ns_list.c b/src/core/ns_list.c index 534f371e3..8248b173c 100644 --- a/src/core/ns_list.c +++ b/src/core/ns_list.c @@ -16,8 +16,6 @@ #include "module.h" #include "hashcomp.h" -void myNickServHelp(User *u); - class CommandNSList : public Command { public: @@ -221,19 +219,12 @@ class NSList : public Module this->SetType(CORE); this->AddCommand(NICKSERV, new CommandNSList(), MOD_UNIQUE); - - this->SetNickHelp(myNickServHelp); + } + void NickServHelp(User *u) + { + if (!NSListOpersOnly || is_oper(u)) + notice_lang(s_NickServ, u, NICK_HELP_CMD_LIST); } }; -/** - * Add the help response to anopes /ns help output. - * @param u The user who is requesting help - **/ -void myNickServHelp(User *u) -{ - if (!NSListOpersOnly || is_oper(u)) - notice_lang(s_NickServ, u, NICK_HELP_CMD_LIST); -} - MODULE_INIT("ns_list", NSList) diff --git a/src/core/ns_logout.c b/src/core/ns_logout.c index a726b1f15..0d68beae3 100644 --- a/src/core/ns_logout.c +++ b/src/core/ns_logout.c @@ -18,8 +18,6 @@ #define TO_COLLIDE 0 /* Collide the user with this nick */ #define TO_RELEASE 1 /* Release a collided nick */ -void myNickServHelp(User *u); - class CommandNSLogout : public Command { public: @@ -112,18 +110,11 @@ class NSLogout : public Module this->SetType(CORE); this->AddCommand(NICKSERV, new CommandNSLogout(), MOD_UNIQUE); - - this->SetNickHelp(myNickServHelp); + } + void NickServHelp(User *u) + { + notice_lang(s_NickServ, u, NICK_HELP_CMD_LOGOUT); } }; -/** - * Add the help response to anopes /ns help output. - * @param u The user who is requesting help - **/ -void myNickServHelp(User *u) -{ - notice_lang(s_NickServ, u, NICK_HELP_CMD_LOGOUT); -} - MODULE_INIT("ns_logout", NSLogout) diff --git a/src/core/ns_recover.c b/src/core/ns_recover.c index 6032ca509..b843d5c30 100644 --- a/src/core/ns_recover.c +++ b/src/core/ns_recover.c @@ -15,8 +15,6 @@ #include "module.h" -void myNickServHelp(User *u); - class CommandNSRecover : public Command { public: @@ -117,18 +115,11 @@ class NSRecover : public Module this->SetType(CORE); this->AddCommand(NICKSERV, new CommandNSRecover(), MOD_UNIQUE); - - this->SetNickHelp(myNickServHelp); + } + void NickServHelp(User *u) + { + notice_lang(s_NickServ, u, NICK_HELP_CMD_RECOVER); } }; -/** - * Add the help response to anopes /ns help output. - * @param u The user who is requesting help - **/ -void myNickServHelp(User *u) -{ - notice_lang(s_NickServ, u, NICK_HELP_CMD_RECOVER); -} - MODULE_INIT("ns_recover", NSRecover) diff --git a/src/core/ns_register.c b/src/core/ns_register.c index c5a6e5120..54bb154a8 100644 --- a/src/core/ns_register.c +++ b/src/core/ns_register.c @@ -16,7 +16,6 @@ #include "module.h" #include "encrypt.h" -void myNickServHelp(User *u); NickRequest *makerequest(const char *nick); NickAlias *makenick(const char *nick); int do_sendregmail(User *u, NickRequest *nr); @@ -423,24 +422,17 @@ class NSRegister : public Module this->AddCommand(NICKSERV, new CommandNSRegister(), MOD_UNIQUE); this->AddCommand(NICKSERV, new CommandNSConfirm("CONFIRM", 0, 1), MOD_UNIQUE); this->AddCommand(NICKSERV, new CommandNSResend(), MOD_UNIQUE); - - this->SetNickHelp(myNickServHelp); } -}; - -/** - * Add the help response to anopes /ns help output. - * @param u The user who is requesting help - **/ -void myNickServHelp(User *u) -{ - notice_lang(s_NickServ, u, NICK_HELP_CMD_REGISTER); - if (NSEmailReg) + void NickServHelp(User *u) { - notice_lang(s_NickServ, u, NICK_HELP_CMD_CONFIRM); - notice_lang(s_NickServ, u, NICK_HELP_CMD_RESEND); + notice_lang(s_NickServ, u, NICK_HELP_CMD_REGISTER); + if (NSEmailReg) + { + notice_lang(s_NickServ, u, NICK_HELP_CMD_CONFIRM); + notice_lang(s_NickServ, u, NICK_HELP_CMD_RESEND); + } } -} +}; /*************************************************************************/ diff --git a/src/core/ns_release.c b/src/core/ns_release.c index 66b0fc043..3603e9976 100644 --- a/src/core/ns_release.c +++ b/src/core/ns_release.c @@ -15,8 +15,6 @@ #include "module.h" -void myNickServHelp(User *u); - class CommandNSRelease : public Command { public: @@ -99,18 +97,11 @@ class NSRelease : public Module this->SetType(CORE); this->AddCommand(NICKSERV, new CommandNSRelease(), MOD_UNIQUE); - - this->SetNickHelp(myNic