X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmodules%2Fm_redirect.cpp;h=5e78ccef2f405f47233290c76e170fc9845d9d7c;hb=f2cdf27dd9c45f91f4184b81ea3b9be7c5d88173;hp=e40339fa6218b4a63665a1068712ebf45ac1503d;hpb=93b12896dab1692800c4b6d2d9f35e1a23102028;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_redirect.cpp b/src/modules/m_redirect.cpp index e40339fa6..5e78ccef2 100644 --- a/src/modules/m_redirect.cpp +++ b/src/modules/m_redirect.cpp @@ -64,7 +64,7 @@ class Redirect : public ModeHandler } } - if (channel->GetModeParameter('L') == parameter) + if (channel->GetModeParameter(this) == parameter) return MODEACTION_DENY; /* * We used to do some checking for circular +L here, but there is no real need for this any more especially as we @@ -74,7 +74,7 @@ class Redirect : public ModeHandler } else { - if (channel->IsModeSet('L')) + if (channel->IsModeSet(this)) { return MODEACTION_ALLOW; } @@ -95,15 +95,14 @@ class AntiRedirect : public SimpleUserModeHandler class ModuleRedirect : public Module { - Redirect re; AntiRedirect re_u; bool UseUsermode; public: - ModuleRedirect() - : re(this), re_u(this) + : re(this) + , re_u(this) { } @@ -133,22 +132,22 @@ class ModuleRedirect : public Module { if (chan) { - if (chan->IsModeSet('L') && chan->IsModeSet('l')) + if (chan->IsModeSet(re) && chan->IsModeSet('l')) { if (chan->GetUserCounter() >= ConvToInt(chan->GetModeParameter('l'))) { - std::string channel = chan->GetModeParameter('L'); + std::string channel = chan->GetModeParameter(&re); /* sometimes broken ulines can make circular or chained +L, avoid this */ Channel* destchan = ServerInstance->FindChan(channel); - if (destchan && destchan->IsModeSet('L')) + if (destchan && destchan->IsModeSet(re)) { user->WriteNumeric(470, "%s %s * :You may not join this channel. A redirect is set, but you may not be redirected as it is a circular loop.", user->nick.c_str(), cname.c_str()); return MOD_RES_DENY; } /* We check the bool value here to make sure we have it enabled, if we don't then usermode +L might be assigned to something else. */ - if (UseUsermode && user->IsModeSet('L')) + if (UseUsermode && user->IsModeSet(re_u)) { user->WriteNumeric(470, "%s %s %s :Force redirection stopped.", user->nick.c_str(), cname.c_str(), channel.c_str()); return MOD_RES_DENY;