]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_denychans.cpp
Replace OnAccessCheck with OnPreMode to remove a number of redundant checks
[user/henk/code/inspircd.git] / src / modules / m_denychans.cpp
index dbfe74400d1d5e7084b902dc2000f5f6e520c4ca..401642e0879786fad9af7ab9b66220fb5e0326c3 100644 (file)
@@ -31,7 +31,7 @@ class ModuleDenyChannels : public Module
                ServerInstance->Modules->Attach(eventlist, this, 2);
        }
 
-       virtual void OnRehash(User* user, const std::string &param)
+       virtual void OnRehash(User* user)
        {
                delete Conf;
                Conf = new ConfigReader(ServerInstance);
@@ -86,7 +86,7 @@ class ModuleDenyChannels : 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)
        {
                for (int j =0; j < Conf->Enumerate("badchan"); j++)
                {
@@ -94,7 +94,7 @@ class ModuleDenyChannels : public Module
                        {
                                if (IS_OPER(user) && Conf->ReadFlag("badchan","allowopers",j))
                                {
-                                       return 0;
+                                       return MOD_RES_PASSTHRU;
                                }
                                else
                                {
@@ -105,7 +105,7 @@ class ModuleDenyChannels : public Module
                                        {
                                                if (InspIRCd::Match(cname, Conf->ReadValue("goodchan", "name", i)))
                                                {
-                                                       return 0;
+                                                       return MOD_RES_PASSTHRU;
                                                }
                                        }
 
@@ -117,16 +117,16 @@ class ModuleDenyChannels : public Module
                                                {
                                                        user->WriteNumeric(926, "%s %s :Channel %s is forbidden, redirecting to %s: %s",user->nick.c_str(),cname,cname,redirect.c_str(), reason.c_str());
                                                        Channel::JoinUser(ServerInstance,user,redirect.c_str(),false,"",false,ServerInstance->Time());
-                                                       return 1;
+                                                       return MOD_RES_DENY;
                                                }
                                        }
 
                                        user->WriteNumeric(926, "%s %s :Channel %s is forbidden: %s",user->nick.c_str(),cname,cname,reason.c_str());
-                                       return 1;
+                                       return MOD_RES_DENY;
                                }
                        }
                }
-               return 0;
+               return MOD_RES_PASSTHRU;
        }
 };