summaryrefslogtreecommitdiff
path: root/src/modules/m_censor.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_censor.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_censor.cpp')
-rw-r--r--src/modules/m_censor.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/modules/m_censor.cpp b/src/modules/m_censor.cpp
index 03d591fa8..e356ee9a7 100644
--- a/src/modules/m_censor.cpp
+++ b/src/modules/m_censor.cpp
@@ -44,14 +44,15 @@ class ModuleCensor : public Module
CensorChannel cc;
public:
- ModuleCensor()
- : cu(this), cc(this)
+ ModuleCensor() : cu(this), cc(this) { }
+
+ void init()
{
/* Read the configuration file on startup.
*/
OnRehash(NULL);
- if (!ServerInstance->Modes->AddMode(&cu) || !ServerInstance->Modes->AddMode(&cc))
- throw ModuleException("Could not add new modes!");
+ ServerInstance->Modules->AddService(cu);
+ ServerInstance->Modules->AddService(cc);
Implementation eventlist[] = { I_OnRehash, I_OnUserPreMessage, I_OnUserPreNotice };
ServerInstance->Modules->Attach(eventlist, this, 3);
}