- if (!ServerInstance->Modes->AddMode(&cu) || !ServerInstance->Modes->AddMode(&cc))
- throw ModuleException("Could not add new modes!");
- Implementation eventlist[] = { I_OnRehash, I_OnUserPreMessage, I_OnUserPreNotice, I_OnRunTestSuite };
- ServerInstance->Modules->Attach(eventlist, this, 4);
- }
-
-
- virtual ~ModuleCensor()
- {
- ServerInstance->Modes->DelMode(&cu);
- ServerInstance->Modes->DelMode(&cc);
+ ServerInstance->Modules->AddService(cu);
+ ServerInstance->Modules->AddService(cc);
+ Implementation eventlist[] = { I_OnRehash, I_OnUserPreMessage };
+ ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));