From 5d474dc9fbd9bd36d0a0a8df93e1ec1e180864d7 Mon Sep 17 00:00:00 2001 From: danieldg Date: Sun, 17 Jan 2010 17:10:45 +0000 Subject: Move initialization that throws configuration exceptions to init() git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12279 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_callerid.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/modules/m_callerid.cpp') diff --git a/src/modules/m_callerid.cpp b/src/modules/m_callerid.cpp index 86d488cd8..bb847d8bc 100644 --- a/src/modules/m_callerid.cpp +++ b/src/modules/m_callerid.cpp @@ -344,13 +344,15 @@ private: public: ModuleCallerID() : cmd(this), myumode(this) { - OnRehash(NULL); + } - if (!ServerInstance->Modes->AddMode(&myumode)) - throw ModuleException("Could not add usermode +g"); + void init() + { + OnRehash(NULL); - ServerInstance->AddCommand(&cmd); - ServerInstance->Extensions.Register(&cmd.extInfo); + ServerInstance->Modules->AddService(myumode); + ServerInstance->Modules->AddService(cmd); + ServerInstance->Modules->AddService(cmd.extInfo); Implementation eventlist[] = { I_OnRehash, I_OnUserPreNick, I_OnUserQuit, I_On005Numeric, I_OnUserPreNotice, I_OnUserPreMessage }; ServerInstance->Modules->Attach(eventlist, this, 6); -- cgit v1.2.3