X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_banredirect.cpp;h=446d575df88f75810d04579adbf883bd432e9041;hb=24623a5fe6ff986ad342e2b00d3576b4899a6033;hp=a772794ab204ccb4afaf33b124f173b1c5ac7bdf;hpb=fd0fa86da89ab4cefa778307088ef2552a05a170;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_banredirect.cpp b/src/modules/m_banredirect.cpp index a772794ab..446d575df 100644 --- a/src/modules/m_banredirect.cpp +++ b/src/modules/m_banredirect.cpp @@ -44,7 +44,7 @@ typedef std::vector BanRedirectList; class BanRedirect : public ModeWatcher { - ModeReference ban; + ChanModeReference ban; public: SimpleExtItem extItem; BanRedirect(Module* parent) @@ -217,15 +217,18 @@ class ModuleBanRedirect : public Module { BanRedirect re; bool nofollow; + ChanModeReference limitmode; + ChanModeReference redirectmode; public: ModuleBanRedirect() - : re(this) + : re(this) + , nofollow(false) + , limitmode(this, "limit") + , redirectmode(this, "redirect") { - nofollow = false; } - void init() CXX11_OVERRIDE { ServerInstance->Modes->AddModeWatcher(&re); @@ -311,9 +314,9 @@ class ModuleBanRedirect : public Module std::string destlimit; if (destchan) - destlimit = destchan->GetModeParameter('l'); + destlimit = destchan->GetModeParameter(limitmode); - if(destchan && ServerInstance->Modules->Find("m_redirect.so") && destchan->IsModeSet('L') && !destlimit.empty() && (destchan->GetUserCounter() >= atoi(destlimit.c_str()))) + if(destchan && destchan->IsModeSet(redirectmode) && !destlimit.empty() && (destchan->GetUserCounter() >= atoi(destlimit.c_str()))) { user->WriteNumeric(474, "%s %s :Cannot join channel (You are banned)", user->nick.c_str(), chan->name.c_str()); return MOD_RES_DENY; @@ -338,7 +341,7 @@ class ModuleBanRedirect : public Module { /* XXX is this the best place to do this? */ if (!ServerInstance->Modes->DelModeWatcher(&re)) - ServerInstance->Logs->Log("m_banredirect.so", LOG_DEBUG, "Failed to delete modewatcher!"); + ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Failed to delete modewatcher!"); } Version GetVersion() CXX11_OVERRIDE