]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_delaymsg.cpp
m_spanningtree Remove unneeded #includes
[user/henk/code/inspircd.git] / src / modules / m_delaymsg.cpp
index 1a0734ed9b01506f3ec3d4949f5ad02602576847..dd54ea362d8a0c059a80598b53d4a76c1c3b8fbd 100644 (file)
@@ -41,16 +41,18 @@ class DelayMsgMode : public ModeHandler
 
 class ModuleDelayMsg : public Module
 {
- private:
        DelayMsgMode djm;
  public:
        ModuleDelayMsg() : djm(this)
        {
-               if (!ServerInstance->Modes->AddMode(&djm))
-                       throw ModuleException("Could not add new modes!");
-               ServerInstance->Extensions.Register(&djm.jointime);
+       }
+
+       void init()
+       {
+               ServerInstance->Modules->AddService(djm);
+               ServerInstance->Modules->AddService(djm.jointime);
                Implementation eventlist[] = { I_OnUserJoin, I_OnUserPreMessage};
-               ServerInstance->Modules->Attach(eventlist, this, 2);
+               ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
        }
        Version GetVersion();
        void OnUserJoin(Membership* memb, bool sync, bool created, CUList&);
@@ -142,4 +144,3 @@ ModResult ModuleDelayMsg::OnUserPreMessage(User* user, void* dest, int target_ty
 }
 
 MODULE_INIT(ModuleDelayMsg)
-