summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/inspircd.cpp1
-rw-r--r--src/mode.cpp29
2 files changed, 11 insertions, 19 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index b3c4ca27d..bac96b2d6 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -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();
diff --git a/src/mode.cpp b/src/mode.cpp
index bbd29c621..8cf04ef08 100644
--- a/src/mode.cpp
+++ b/src/mode.cpp
@@ -933,28 +933,21 @@ struct builtin_modes
ModeUserOperator uo;
ModeUserServerNoticeMask us;
- void init(ModeParser* modes)
- {
- 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);
+ void init()
+ {
+ 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()