]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_redirect.cpp
m_callerid Route ACCEPT to the server of the target user only, do not send METADATA...
[user/henk/code/inspircd.git] / src / modules / m_redirect.cpp
index 318d26d2e20df1b371651c53ffd303e70b6c4e3f..000d53a2e21055d5aa57a57dbc5bb91ebf9e242e 100644 (file)
@@ -39,7 +39,7 @@ class Redirect : public ModeHandler
                {
                        if (IS_LOCAL(source))
                        {
-                               if (!ServerInstance->IsChannel(parameter.c_str(), ServerInstance->Config->Limits.ChanMax))
+                               if (!ServerInstance->IsChannel(parameter))
                                {
                                        source->WriteNumeric(403, "%s %s :Invalid channel name", source->nick.c_str(), parameter.c_str());
                                        parameter.clear();
@@ -47,7 +47,7 @@ class Redirect : public ModeHandler
                                }
                        }
 
-                       if (IS_LOCAL(source) && !IS_OPER(source))
+                       if (IS_LOCAL(source) && !source->IsOper())
                        {
                                Channel* c = ServerInstance->FindChan(parameter);
                                if (!c)
@@ -109,7 +109,7 @@ class ModuleRedirect : public Module
        {
        }
 
-       void init()
+       void init() CXX11_OVERRIDE
        {
                /* Setting this here so it isn't changable by rehasing the config later. */
                UseUsermode = ServerInstance->Config->ConfValue("redirect")->getBool("antiredirect");
@@ -121,7 +121,7 @@ class ModuleRedirect : public Module
                if (UseUsermode)
                {
                        /* Log noting that this breaks compatability. */
-                       ServerInstance->Logs->Log("m_redirect", DEFAULT, "REDIRECT: Enabled usermode +L. This breaks linking with servers that do not have this enabled. This is disabled by default in the 2.0 branch but will be enabled in the next version.");
+                       ServerInstance->Logs->Log("m_redirect", LOG_DEFAULT, "REDIRECT: Enabled usermode +L. This breaks linking with servers that do not have this enabled. This is disabled by default in the 2.0 branch but will be enabled in the next version.");
 
                        /* Try to add the usermode */
                        ServerInstance->Modules->AddService(re_u);
@@ -131,7 +131,7 @@ class ModuleRedirect : public Module
                ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
        }
 
-       ModResult OnUserPreJoin(User* user, Channel* chan, const std::string& cname, std::string& privs, const std::string& keygiven)
+       ModResult OnUserPreJoin(LocalUser* user, Channel* chan, const std::string& cname, std::string& privs, const std::string& keygiven) CXX11_OVERRIDE
        {
                if (chan)
                {
@@ -142,8 +142,7 @@ class ModuleRedirect : public Module
                                        std::string channel = chan->GetModeParameter('L');
 
                                        /* sometimes broken ulines can make circular or chained +L, avoid this */
-                                       Channel* destchan = NULL;
-                                       destchan = ServerInstance->FindChan(channel);
+                                       Channel* destchan = ServerInstance->FindChan(channel);
                                        if (destchan && destchan->IsModeSet('L'))
                                        {
                                                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());
@@ -159,7 +158,7 @@ class ModuleRedirect : public Module
                                        else
                                        {
                                                user->WriteNumeric(470, "%s %s %s :You may not join this channel, so you are automatically being transferred to the redirect channel.", user->nick.c_str(), cname.c_str(), channel.c_str());
-                                               Channel::JoinUser(user, channel, false, "", false, ServerInstance->Time());
+                                               Channel::JoinUser(user, channel);
                                                return MOD_RES_DENY;
                                        }
                                }
@@ -168,7 +167,7 @@ class ModuleRedirect : public Module
                return MOD_RES_PASSTHRU;
        }
 
-       virtual Version GetVersion()
+       Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Provides channel mode +L (limit redirection) and user mode +L (no forced redirection)", VF_VENDOR);
        }