]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_restrictchans.cpp
Introduce "X" snomask for remote *:line messages [patch by jackmcbarn]
[user/henk/code/inspircd.git] / src / modules / m_restrictchans.cpp
index 2bda65effea1d1a4c5d4d4009b1871e924f7e1f3..68aa455e7bdcbf84420d4536b204d8a27e429f94 100644 (file)
@@ -3,7 +3,7 @@
  *       +------------------------------------+
  *
  *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
- * See: http://www.inspircd.org/wiki/index.php/Credits
+ * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
  *         the file COPYING for details.
@@ -45,17 +45,17 @@ class ModuleRestrictChans : public Module
                ServerInstance->Modules->Attach(eventlist, this, 2);
        }
 
-       virtual void OnRehash(User* user, const std::string &parameter)
+       virtual void OnRehash(User* user)
        {
                ReadConfig();
        }
 
 
-       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)
        {
                irc::string x = cname;
                if (!IS_LOCAL(user))
-                       return 0;
+                       return MOD_RES_PASSTHRU;
 
                // channel does not yet exist (record is null, about to be created IF we were to allow it)
                if (!chan)
@@ -64,10 +64,10 @@ class ModuleRestrictChans : public Module
                        if ((!IS_OPER(user)) && (allowchans.find(x) == allowchans.end()))
                        {
                                user->WriteNumeric(ERR_BANNEDFROMCHAN, "%s %s :Only IRC operators may create new channels",user->nick.c_str(),cname);
-                               return 1;
+                               return MOD_RES_DENY;
                        }
                }
-               return 0;
+               return MOD_RES_PASSTHRU;
        }
 
        virtual ~ModuleRestrictChans()