]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_restrictchans.cpp
Probably wont compile yet - purge_empty_channels refactor
[user/henk/code/inspircd.git] / src / modules / m_restrictchans.cpp
index 0ca0dd921602c8dd77d7056ae0f928f645c2cdc9..b6d34bf259f1616a54c57bf8fb90116c94cd514a 100644 (file)
@@ -25,10 +25,9 @@ using namespace std;
 
 /* $ModDesc: Only opers may create new channels if this module is loaded */
 
-Server *Srv;
-        
 class ModuleRestrictChans : public Module
 {
+       Server* Srv;
 
        std::map<irc::string,int> allowchans;
 
@@ -68,7 +67,7 @@ class ModuleRestrictChans : public Module
        {
                irc::string x = cname;
                // user is not an oper and its not in the allow list
-               if ((!strchr(user->modes,'o')) && (allowchans.find(x) == allowchans.end()))
+               if ((!*user->oper) && (allowchans.find(x) == allowchans.end()))
                {
                        // channel does not yet exist (record is null, about to be created IF we were to allow it)
                        if (!chan)