]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_restrictchans.cpp
Add <showwhois:opersonly>, allows server admins to unlock umode +W use for regular...
[user/henk/code/inspircd.git] / src / modules / m_restrictchans.cpp
index 7b229687f8a68f91728e3ed931197804034fc8a6..02d7d6a3ab31739f844c2ef93b04e2ca45d8e936 100644 (file)
@@ -54,13 +54,16 @@ class ModuleRestrictChans : public Module
        virtual int OnUserPreJoin(User* user, Channel* chan, const char* cname, std::string &privs, const std::string &keygiven)
        {
                irc::string x = cname;
-               // user is not an oper and its not in the allow list
-               if ((!IS_OPER(user)) && (allowchans.find(x) == allowchans.end()))
+               if (!IS_LOCAL(user))
+                       return 0;
+
+               // channel does not yet exist (record is null, about to be created IF we were to allow it)
+               if (!chan)
                {
-                       // channel does not yet exist (record is null, about to be created IF we were to allow it)
-                       if (!chan)
+                       // user is not an oper and its not in the allow list
+                       if ((!IS_OPER(user)) && (allowchans.find(x) == allowchans.end()))
                        {
-                               user->WriteNumeric(530, "%s %s :Only IRC operators may create new channels",user->nick.c_str(),cname);
+                               user->WriteNumeric(ERR_BANNEDFROMCHAN, "%s %s :Only IRC operators may create new channels",user->nick.c_str(),cname);
                                return 1;
                        }
                }
@@ -73,7 +76,7 @@ class ModuleRestrictChans : public Module
 
        virtual Version GetVersion()
        {
-               return Version(1,2,0,1,VF_VENDOR,API_VERSION);
+               return Version("$Id$",VF_VENDOR,API_VERSION);
        }
 };