mirror of
https://github.com/anope/anope.git
synced 2026-07-09 10:43:13 +02:00
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
This commit is contained in:
@@ -48,8 +48,6 @@
|
||||
#define LNG_CHAN_HELP_APPENDTOPIC 1
|
||||
#define LNG_APPENDTOPIC_SYNTAX 2
|
||||
|
||||
void my_cs_help(User *u);
|
||||
|
||||
static Module *me;
|
||||
|
||||
class CommandCSAppendTopic : public Command
|
||||
@@ -145,7 +143,6 @@ class CSAppendTopic : public Module
|
||||
this->SetType(SUPPORTED);
|
||||
|
||||
this->AddCommand(CHANSERV, new CommandCSAppendTopic(), MOD_HEAD);
|
||||
this->SetChanHelp(my_cs_help);
|
||||
|
||||
/* English (US) */
|
||||
const char* langtable_en_us[] = {
|
||||
@@ -227,11 +224,10 @@ class CSAppendTopic : public Module
|
||||
this->InsertLanguage(LANG_RU, LNG_NUM_STRINGS, langtable_ru);
|
||||
this->InsertLanguage(LANG_IT, LNG_NUM_STRINGS, langtable_it);
|
||||
}
|
||||
void ChanServHelp(User *u)
|
||||
{
|
||||
this->NoticeLang(s_ChanServ, u, LNG_CHAN_HELP);
|
||||
}
|
||||
};
|
||||
|
||||
void my_cs_help(User *u)
|
||||
{
|
||||
me->NoticeLang(s_ChanServ, u, LNG_CHAN_HELP);
|
||||
}
|
||||
|
||||
MODULE_INIT("cs_appendtopic", CSAppendTopic)
|
||||
|
||||
@@ -18,8 +18,6 @@
|
||||
#define AUTHOR "Anope"
|
||||
#define VERSION "$Id$"
|
||||
|
||||
void my_cs_help(User *u);
|
||||
|
||||
#define LNG_NUM_STRINGS 6
|
||||
|
||||
#define LNG_CHAN_HELP 0
|
||||
@@ -262,8 +260,6 @@ class CSEnforce : public Module
|
||||
|
||||
this->AddCommand(CHANSERV, new CommandCSEnforce(), MOD_HEAD);
|
||||
|
||||
this->SetChanHelp(my_cs_help);
|
||||
|
||||
/* English (US) */
|
||||
const char* langtable_en_us[] = {
|
||||
/* LNG_CHAN_HELP */
|
||||
@@ -472,12 +468,10 @@ class CSEnforce : public Module
|
||||
this->InsertLanguage(LANG_RU, LNG_NUM_STRINGS, langtable_ru);
|
||||
this->InsertLanguage(LANG_IT, LNG_NUM_STRINGS, langtable_it);
|
||||
}
|
||||
void ChanServHelp(User *u)
|
||||
{
|
||||
this->NoticeLang(s_ChanServ, u, LNG_CHAN_HELP);
|
||||
}
|
||||
};
|
||||
|
||||
/* Language and response stuff */
|
||||
void my_cs_help(User *u)
|
||||
{
|
||||
me->NoticeLang(s_ChanServ, u, LNG_CHAN_HELP);
|
||||
}
|
||||
|
||||
MODULE_INIT("cs_enforce", CSEnforce)
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#define AUTHOR "Rob"
|
||||
#define VERSION "$Id$"
|
||||
|
||||
void myHelp(User *u);
|
||||
void mySendResponse(User *u, const char *channel, char *mask, const char *time);
|
||||
|
||||
void addBan(Channel *c, time_t timeout, char *banmask);
|
||||
@@ -94,7 +93,6 @@ class CSTBan : public Module
|
||||
{
|
||||
me = this;
|
||||
|
||||
this->SetChanHelp(myHelp);
|
||||
this->AddCommand(CHANSERV, new CommandCSTBan(), MOD_HEAD);
|
||||
|
||||
this->SetAuthor(AUTHOR);
|
||||
@@ -158,13 +156,12 @@ class CSTBan : public Module
|
||||
this->InsertLanguage(LANG_RU, LANG_NUM_STRINGS, langtable_ru);
|
||||
this->InsertLanguage(LANG_IT, LANG_NUM_STRINGS, langtable_it);
|
||||
}
|
||||
void ChanServHelp(User *u)
|
||||
{
|
||||
this->NoticeLang(s_ChanServ, u, TBAN_HELP);
|
||||
}
|
||||
};
|
||||
|
||||
void myHelp(User *u)
|
||||
{
|
||||
me->NoticeLang(s_ChanServ, u, TBAN_HELP);
|
||||
}
|
||||
|
||||
void mySendResponse(User *u, const char *channel, char *mask, const char *time)
|
||||
{
|
||||
me->NoticeLang(s_ChanServ, u, TBAN_RESPONSE, mask, channel, time);
|
||||
|
||||
@@ -53,8 +53,6 @@ char *HSRequestDBName = NULL;
|
||||
#define LNG_WAITING_SYNTAX 19
|
||||
#define LNG_HELP_WAITING 20
|
||||
|
||||
void hs_help(User *u);
|
||||
|
||||
void my_add_host_request(char *nick, char *vIdent, char *vhost, char *creator, int32 tmp_time);
|
||||
int my_isvalidchar(const char c);
|
||||
void my_memo_lang(User *u, char *name, int z, int number, ...);
|
||||
@@ -416,7 +414,6 @@ class HSRequest : public Module
|
||||
ModuleManager::Attach(I_OnSaveDatabase, this);
|
||||
ModuleManager::Attach(I_OnBackupDatabase, this);
|
||||
|
||||
this->SetHostHelp(hs_help);
|
||||
this->SetAuthor(AUTHOR);
|
||||
this->SetVersion(VERSION);
|
||||
this->SetType(SUPPORTED);
|
||||
@@ -767,6 +764,12 @@ class HSRequest : public Module
|
||||
else
|
||||
ModuleDatabaseBackup(HSREQ_DEFAULT_DBNAME);
|
||||
}
|
||||
|
||||
void HostServHelp(User *u)
|
||||
{
|
||||
this->NoticeLang(s_HostServ, u, LNG_HELP);
|
||||
this->NoticeLang(s_HostServ, u, LNG_HELP_SETTER);
|
||||
}
|
||||
};
|
||||
|
||||
void my_memo_lang(User *u, char *name, int z, int number, ...)
|
||||
@@ -871,12 +874,6 @@ int my_isvalidchar(const char c)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void hs_help(User * u)
|
||||
{
|
||||
me->NoticeLang(s_HostServ, u, LNG_HELP);
|
||||
me->NoticeLang(s_HostServ, u, LNG_HELP_SETTER);
|
||||
}
|
||||
|
||||
void hsreq_load_db()
|
||||
{
|
||||
FILE *fp;
|
||||
|
||||
@@ -43,9 +43,6 @@ int m_isIRCop = 0;
|
||||
|
||||
char *NSAutoOPDBName;
|
||||
|
||||
int myNickServAutoOpHelp(User * u);
|
||||
void myNickServHelp(User * u);
|
||||
|
||||
int noop(User * u);
|
||||
int mEventJoin(int argc, char **argv);
|
||||
int setAutoOp(User * u);
|
||||
|
||||
+11
-22
@@ -42,9 +42,6 @@
|
||||
|
||||
char *OSInfoDBName = NULL;
|
||||
|
||||
void mMainChanHelp(User *u);
|
||||
void mMainNickHelp(User *u);
|
||||
|
||||
int mLoadData();
|
||||
int mLoadConfig();
|
||||
|
||||
@@ -252,9 +249,6 @@ class OSInfo : public Module
|
||||
ModuleManager::Attach(I_OnSaveDatabase, this);
|
||||
ModuleManager::Attach(I_OnBackupDatabase, this);
|
||||
|
||||
this->SetNickHelp(mMainNickHelp);
|
||||
this->SetChanHelp(mMainChanHelp);
|
||||
|
||||
mLoadData();
|
||||
ModuleManager::Attach(I_OnReload, this);
|
||||
|
||||
@@ -589,6 +583,17 @@ class OSInfo : public Module
|
||||
ModuleDatabaseBackup(OSInfoDBName);
|
||||
}
|
||||
|
||||
void NickServHelp(User *u)
|
||||
{
|
||||
if (is_oper(u))
|
||||
this->NoticeLang(s_NickServ, u, OINFO_HELP_CMD);
|
||||
}
|
||||
|
||||
void ChanServHelp(User *u)
|
||||
{
|
||||
if (is_oper(u))
|
||||
this->NoticeLang(s_ChanServ, u, OCINFO_HELP_CMD);
|
||||
}
|
||||
};
|
||||
|
||||
/*************************************************************************/
|
||||
@@ -674,22 +679,6 @@ int mLoadConfig()
|
||||
}
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
/* This help will be added to the main NickServ list */
|
||||
void mMainNickHelp(User *u)
|
||||
{
|
||||
if (is_oper(u))
|
||||
me->NoticeLang(s_NickServ, u, OINFO_HELP_CMD);
|
||||
}
|
||||
|
||||
/* This help will be added to the main ChanServ list */
|
||||
void mMainChanHelp(User *u)
|
||||
{
|
||||
if (is_oper(u))
|
||||
me->NoticeLang(s_ChanServ, u, OCINFO_HELP_CMD);
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
MODULE_INIT("os_info", OSInfo)
|
||||
|
||||
Reference in New Issue
Block a user