summaryrefslogtreecommitdiff
path: root/src/modules/m_chanprotect.cpp
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2010-01-17 16:00:14 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2010-01-17 16:00:14 +0000
commit4b6bdeccb537b6f8030172c37afa7dc324e26765 (patch)
tree9c165894ba0a62072f81630fbba789770f2b63ba /src/modules/m_chanprotect.cpp
parent92974819e3bf1c3a97b83f6f4ccc612283120794 (diff)
Add Module::init() for correct exception handling during hook registration
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12278 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_chanprotect.cpp')
-rw-r--r--src/modules/m_chanprotect.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/modules/m_chanprotect.cpp b/src/modules/m_chanprotect.cpp
index 61ffa3ad2..62e41416b 100644
--- a/src/modules/m_chanprotect.cpp
+++ b/src/modules/m_chanprotect.cpp
@@ -231,14 +231,16 @@ class ModuleChanProtect : public Module
public:
ModuleChanProtect() : cp(this), cf(this)
{
+ }
+
+ void init()
+ {
/* Load config stuff */
LoadSettings();
settings.booting = false;
- if (!ServerInstance->Modes->AddMode(&cp) || !ServerInstance->Modes->AddMode(&cf))
- {
- throw ModuleException("Could not add new modes!");
- }
+ ServerInstance->Modules->AddService(cf);
+ ServerInstance->Modules->AddService(cp);
Implementation eventlist[] = { I_OnUserPreJoin };
ServerInstance->Modules->Attach(eventlist, this, 1);