From 4b6bdeccb537b6f8030172c37afa7dc324e26765 Mon Sep 17 00:00:00 2001 From: danieldg Date: Sun, 17 Jan 2010 16:00:14 +0000 Subject: 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 --- src/modules/m_chanprotect.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/modules/m_chanprotect.cpp') 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 @@ -230,15 +230,17 @@ class ModuleChanProtect : public Module ChanFounder cf; 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); -- cgit v1.2.3