- CensorUser *cu;
- CensorChannel *cc;
-
- public:
- ModuleCensor(InspIRCd* Me)
- : Module(Me)
- {
- /* Read the configuration file on startup.
- */
- OnRehash(NULL,"");
- cu = new CensorUser(ServerInstance);
- cc = new CensorChannel(ServerInstance);
- if (!ServerInstance->AddMode(cu) || !ServerInstance->AddMode(cc))
- throw ModuleException("Could not add new modes!");
- Implementation eventlist[] = { I_OnRehash, I_OnUserPreMessage, I_OnUserPreNotice };
- ServerInstance->Modules->Attach(eventlist, this, 3);
- }
-
- void Implements(char* List)
- {
- List[I_OnRehash] = List[I_OnUserPreMessage] = List[I_OnUserPreNotice] = 1;
- }
-
- virtual ~ModuleCensor()
- {
- ServerInstance->Modes->DelMode(cu);
- ServerInstance->Modes->DelMode(cc);
- delete cu;
- delete cc;
- }