]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_denychans.cpp
Socket engine tweaks to fix a glitch, and improvements to new m_ident
[user/henk/code/inspircd.git] / src / modules / m_denychans.cpp
index db42ab43ace3673cc8aaa89162c57708127baebf..d345570c0ac8fe7cab9c992b2d4dc646f66ddf93 100644 (file)
  * ---------------------------------------------------
  */
 
-#include "users.h"
-#include "channels.h"
-#include "modules.h"
-#include "hashcomp.h"
 #include "inspircd.h"
 #include "wildcard.h"
 
@@ -28,13 +24,13 @@ class ModuleDenyChannels : public Module
        ConfigReader *Conf;
 
  public:
-       ModuleDenyChannels(InspIRCd* Me) : Module::Module(Me)
+       ModuleDenyChannels(InspIRCd* Me) : Module(Me)
        {
                
                Conf = new ConfigReader(ServerInstance);
        }
        
-       virtual void OnRehash(userrec* user, const std::string &param)
+       virtual void OnRehash(User* user, const std::string &param)
        {
                DELETE(Conf);
                Conf = new ConfigReader(ServerInstance);
@@ -55,7 +51,7 @@ class ModuleDenyChannels : 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)
        {
                for (int j =0; j < Conf->Enumerate("badchan"); j++)
                {
@@ -77,29 +73,4 @@ class ModuleDenyChannels : public Module
        }
 };
 
-// stuff down here is the module-factory stuff. For basic modules you can ignore this.
-
-class ModuleDenyChannelsFactory : public ModuleFactory
-{
- public:
-       ModuleDenyChannelsFactory()
-       {
-       }
-       
-       ~ModuleDenyChannelsFactory()
-       {
-       }
-       
-       virtual Module * CreateModule(InspIRCd* Me)
-       {
-               return new ModuleDenyChannels(Me);
-       }
-       
-};
-
-
-extern "C" void * init_module( void )
-{
-       return new ModuleDenyChannelsFactory;
-}
-
+MODULE_INIT(ModuleDenyChannels)