]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_restrictchans.cpp
Some more to fix still, modules probably wont load correctly atm
[user/henk/code/inspircd.git] / src / modules / m_restrictchans.cpp
index 3d5325fe6c2fb337769a141bbb5b504f1ce74021..015025c032c3c39491d42141bf7e785ef6fab401 100644 (file)
@@ -12,9 +12,6 @@
  */
 
 #include "inspircd.h"
-#include "users.h"
-#include "channels.h"
-#include "modules.h"
 
 /* $ModDesc: Only opers may create new channels if this module is loaded */
 
@@ -44,9 +41,11 @@ class ModuleRestrictChans : public Module
        {
                
                ReadConfig();
+               Implementation eventlist[] = { I_OnUserPreJoin, I_OnRehash };
+               ServerInstance->Modules->Attach(eventlist, this, 2);
        }
 
-       virtual void OnRehash(userrec* user, const std::string &parameter)
+       virtual void OnRehash(User* user, const std::string &parameter)
        {
                ReadConfig();
        }
@@ -56,7 +55,7 @@ class ModuleRestrictChans : public Module
                List[I_OnUserPreJoin] = List[I_OnRehash] = 1;
        }
        
-       virtual int OnUserPreJoin(userrec* user, chanrec* chan, const char* cname, std::string &privs)
+       virtual int OnUserPreJoin(User* user, Channel* chan, const char* cname, std::string &privs)
        {
                irc::string x = cname;
                // user is not an oper and its not in the allow list
@@ -82,4 +81,4 @@ class ModuleRestrictChans : public Module
        }
 };
 
-MODULE_INIT(ModuleRestrictChans);
+MODULE_INIT(ModuleRestrictChans)