]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_redirect.cpp
Replace OnAccessCheck with OnPreMode to remove a number of redundant checks
[user/henk/code/inspircd.git] / src / modules / m_redirect.cpp
index dd7d2e9545c1648ee20c717c6efc46a40e27f53d..667ab307ff2048bb1a3ab1be7dceb0f8a4fab45a 100644 (file)
@@ -53,7 +53,7 @@ class Redirect : public ModeHandler
                                        parameter.clear();
                                        return MODEACTION_DENY;
                                }
-                               else if (c->GetStatus(source) < STATUS_OP)
+                               else if (c->GetPrefixValue(source) < OP_VALUE)
                                {
                                        source->WriteNumeric(690, "%s :You must be opped on %s to set it as a redirect.",source->nick.c_str(),parameter.c_str());
                                        parameter.clear();
@@ -100,7 +100,7 @@ class ModuleRedirect : public Module
        }
 
 
-       virtual int OnUserPreJoin(User* user, Channel* chan, const char* cname, std::string &privs, const std::string &keygiven)
+       virtual ModResult OnUserPreJoin(User* user, Channel* chan, const char* cname, std::string &privs, const std::string &keygiven)
        {
                if (chan)
                {
@@ -116,16 +116,16 @@ class ModuleRedirect : public Module
                                        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);
-                                               return 1;
+                                               return MOD_RES_DENY;
                                        }
 
                                        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, channel.c_str());
                                        Channel::JoinUser(ServerInstance, user, channel.c_str(), false, "", false, ServerInstance->Time());
-                                       return 1;
+                                       return MOD_RES_DENY;
                                }
                        }
                }
-               return 0;
+               return MOD_RES_PASSTHRU;
        }
 
        virtual ~ModuleRedirect()