- // read the configuration file on startup.
- // it is perfectly valid to set <censor file> to the value of the
- // main config file, then append your <badword> tags to the bottom
- // of the main config... but rather messy. That's why the capability
- // of using a seperate config file is provided.
- Srv = new Server;
- Conf = new ConfigReader;
- std::string Censorfile = Conf->ReadValue("censor","file",0);
- MyConf = new ConfigReader(Censorfile);
- if ((Censorfile == "") || (!MyConf->Verify()))
- {
- printf("Error, could not find <censor file=\"\"> definition in your config file!");
- exit(0);
- }
- Srv->Log(DEFAULT,std::string("m_censor: read configuration from ")+Censorfile);
- Srv->AddExtendedMode('G',MT_CHANNEL,false,0,0);
- Srv->AddExtendedMode('G',MT_CLIENT,false,0,0);
+ /* Read the configuration file on startup.
+ */
+ OnRehash(NULL);
+ 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);