X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_banredirect.cpp;h=bec69e60840964484dd30000a62d4ecec0ac31fe;hb=5d67a5fff127bf95bca69b436ef7f645f2fe3281;hp=9301bf4d5a7d216cf620bf0add4f0e2237267c12;hpb=97b48b5e01bb22074ef578bfd35cde3958fc3f53;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_banredirect.cpp b/src/modules/m_banredirect.cpp index 9301bf4d5..bec69e608 100644 --- a/src/modules/m_banredirect.cpp +++ b/src/modules/m_banredirect.cpp @@ -127,12 +127,12 @@ class BanRedirect : public ModeWatcher Channel *c = ServerInstance->FindChan(mask[CHAN].c_str()); if (!c) { - source->WriteNumeric(690, "%s :Target channel %s must exist to be set as a redirect.",source->nick.c_str(),parameter.c_str()); + source->WriteNumeric(690, "%s :Target channel %s must exist to be set as a redirect.",source->nick.c_str(),mask[CHAN].c_str()); return false; } else if (c->GetStatus(source) < STATUS_OP) { - source->WriteNumeric(690, "%s :You must be opped on %s to set it as a redirect.",source->nick.c_str(),parameter.c_str()); + source->WriteNumeric(690, "%s :You must be opped on %s to set it as a redirect.",source->nick.c_str(), mask[CHAN].c_str()); return false; } @@ -195,24 +195,20 @@ class BanRedirect : public ModeWatcher class ModuleBanRedirect : public Module { - BanRedirect* re; + BanRedirect re; bool nofollow; Module* ExceptionModule; public: ModuleBanRedirect(InspIRCd* Me) - : Module(Me) + : Module(Me), re(Me) { - re = new BanRedirect(Me); nofollow = false; - if(!ServerInstance->Modes->AddModeWatcher(re)) - { - delete re; + if(!ServerInstance->Modes->AddModeWatcher(&re)) throw ModuleException("Could not add mode watcher"); - } - OnRehash(NULL, ""); + OnRehash(NULL); Implementation list[] = { I_OnRehash, I_OnUserPreJoin, I_OnChannelDelete, I_OnCleanup }; Me->Modules->Attach(list, this, 4); @@ -262,7 +258,7 @@ class ModuleBanRedirect : public Module } } - virtual void OnRehash(User* user, const std::string ¶m) + virtual void OnRehash(User* user) { ExceptionModule = ServerInstance->Modules->Find("m_banexception.so"); } @@ -333,8 +329,7 @@ class ModuleBanRedirect : public Module virtual ~ModuleBanRedirect() { - ServerInstance->Modes->DelModeWatcher(re); - delete re; + ServerInstance->Modes->DelModeWatcher(&re); } virtual Version GetVersion()