X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_censor.cpp;h=fc640624ce3529b189d4b0d1a297648608fe90a1;hb=26cd5393c9308fabe73c41870f06f73a5b001cd7;hp=af3baa292c260940a03d5bd40b1d46922ae94244;hpb=7d93921aabd9c608821baec8a871aff844dfae49;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_censor.cpp b/src/modules/m_censor.cpp index af3baa292..fc640624c 100644 --- a/src/modules/m_censor.cpp +++ b/src/modules/m_censor.cpp @@ -26,7 +26,7 @@ typedef std::map censor_t; class CensorUser : public SimpleUserModeHandler { public: - CensorUser(InspIRCd* Instance, Module* Creator) : SimpleUserModeHandler(Creator, 'G') { } + CensorUser(Module* Creator) : SimpleUserModeHandler(Creator, "censor", 'G') { } }; /** Handles channel mode +G @@ -34,7 +34,7 @@ class CensorUser : public SimpleUserModeHandler class CensorChannel : public SimpleChannelModeHandler { public: - CensorChannel(InspIRCd* Instance, Module* Creator) : SimpleChannelModeHandler(Instance, Creator, 'G') { } + CensorChannel(Module* Creator) : SimpleChannelModeHandler(Creator, "censor", 'G') { } }; class ModuleCensor : public Module @@ -44,8 +44,8 @@ class ModuleCensor : public Module CensorChannel cc; public: - ModuleCensor(InspIRCd* Me) - : Module(Me), cu(Me, this), cc(Me, this) + ModuleCensor() + : cu(this), cc(this) { /* Read the configuration file on startup. */ @@ -59,8 +59,6 @@ class ModuleCensor : public Module virtual ~ModuleCensor() { - ServerInstance->Modes->DelMode(&cu); - ServerInstance->Modes->DelMode(&cc); } // format of a config entry is @@ -77,7 +75,7 @@ class ModuleCensor : public Module { active = ((Channel*)dest)->IsModeSet('G'); Channel* c = (Channel*)dest; - if (CHANOPS_EXEMPT(ServerInstance, 'G') && c->GetPrefixValue(user) == OP_VALUE) + if (CHANOPS_EXEMPT('G') && c->GetPrefixValue(user) == OP_VALUE) { return MOD_RES_PASSTHRU; } @@ -115,7 +113,7 @@ class ModuleCensor : public Module * reload our config file on rehash - we must destroy and re-allocate the classes * to call the constructor again and re-read our data. */ - ConfigReader* MyConf = new ConfigReader(ServerInstance); + ConfigReader* MyConf = new ConfigReader; censors.clear(); for (int index = 0; index < MyConf->Enumerate("badword"); index++)