mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-10 02:59:01 -04:00
Add builtin modes using AddService()
This commit is contained in:
parent
1bf6cf727d
commit
0ce252f05c
@ -445,9 +445,6 @@ class CoreExport ModeParser
|
||||
unsigned int seq;
|
||||
|
||||
public:
|
||||
|
||||
/** The constructor initializes all the RFC basic modes by using ModeParserAddMode().
|
||||
*/
|
||||
ModeParser();
|
||||
~ModeParser();
|
||||
|
||||
@ -455,6 +452,11 @@ class CoreExport ModeParser
|
||||
* for example, should 'user A' be able to 'op' on 'channel B'.
|
||||
*/
|
||||
User* SanityChecks(User *user,const char *dest,Channel *chan,int status);
|
||||
|
||||
/** Initialize all built-in modes
|
||||
*/
|
||||
static void InitBuiltinModes();
|
||||
|
||||
/** Tidy a banmask. This makes a banmask 'acceptable' if fields are left out.
|
||||
* E.g.
|
||||
*
|
||||
|
@ -516,6 +516,7 @@ InspIRCd::InspIRCd(int argc, char** argv) :
|
||||
this->Config->Read();
|
||||
this->Config->Apply(NULL, "");
|
||||
Logs->OpenFileLogs();
|
||||
ModeParser::InitBuiltinModes();
|
||||
|
||||
this->Res = new DNS();
|
||||
|
||||
|
27
src/mode.cpp
27
src/mode.cpp
@ -933,28 +933,21 @@ struct builtin_modes
|
||||
ModeUserOperator uo;
|
||||
ModeUserServerNoticeMask us;
|
||||
|
||||
void init(ModeParser* modes)
|
||||
void init()
|
||||
{
|
||||
modes->AddMode(&s);
|
||||
modes->AddMode(&p);
|
||||
modes->AddMode(&m);
|
||||
modes->AddMode(&t);
|
||||
modes->AddMode(&n);
|
||||
modes->AddMode(&i);
|
||||
modes->AddMode(&k);
|
||||
modes->AddMode(&l);
|
||||
modes->AddMode(&b);
|
||||
modes->AddMode(&o);
|
||||
modes->AddMode(&v);
|
||||
modes->AddMode(&uw);
|
||||
modes->AddMode(&ui);
|
||||
modes->AddMode(&uo);
|
||||
modes->AddMode(&us);
|
||||
ServiceProvider* modes[] = { &s, &p, &m, &t, &n, &i, &k, &l, &b, &o, &v,
|
||||
&uw, &ui, &uo, &us };
|
||||
ServerInstance->Modules->AddServices(modes, sizeof(modes)/sizeof(ServiceProvider*));
|
||||
}
|
||||
};
|
||||
|
||||
static builtin_modes static_modes;
|
||||
|
||||
void ModeParser::InitBuiltinModes()
|
||||
{
|
||||
static_modes.init();
|
||||
}
|
||||
|
||||
ModeParser::ModeParser()
|
||||
{
|
||||
/* Clear mode handler list */
|
||||
@ -965,8 +958,6 @@ ModeParser::ModeParser()
|
||||
|
||||
seq = 0;
|
||||
memset(&sent, 0, sizeof(sent));
|
||||
|
||||
static_modes.init(this);
|
||||
}
|
||||
|
||||
ModeParser::~ModeParser()
|
||||
|
Loading…
x
Reference in New Issue
Block a user