]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_sslmodes.cpp
Next part of Development/Hooking (see wiki)
[user/henk/code/inspircd.git] / src / modules / m_sslmodes.cpp
index c8eee5a0362fceade3cc1ae5615f1e4f22bb6e14..0cdb606979255fedd02c001d3ec52497499e3830 100644 (file)
@@ -12,9 +12,6 @@
  */
 
 #include "inspircd.h"
-#include "users.h"
-#include "channels.h"
-#include "modules.h"
 
 /* $ModDesc: Provides support for unreal-style channel mode +z */
 
@@ -27,7 +24,7 @@ class SSLMode : public ModeHandler
  public:
        SSLMode(InspIRCd* Instance) : ModeHandler(Instance, 'z', 0, 0, false, MODETYPE_CHANNEL, false) { }
 
-       ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding)
+       ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
        {
                if (adding)
                {
@@ -78,7 +75,7 @@ class ModuleSSLModes : public Module
                
 
                sslm = new SSLMode(ServerInstance);
-               if (!ServerInstance->AddMode(sslm, 'z'))
+               if (!ServerInstance->AddMode(sslm))
                        throw ModuleException("Could not add new modes!");
        }
 
@@ -87,7 +84,7 @@ class ModuleSSLModes : public Module
                List[I_OnUserPreJoin] = 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)
        {
                if(chan && chan->IsModeSet('z'))
                {
@@ -120,26 +117,5 @@ class ModuleSSLModes : public Module
 };
 
 
-class ModuleSSLModesFactory : public ModuleFactory
-{
- public:
-       ModuleSSLModesFactory()
-       {
-       }
-       
-       ~ModuleSSLModesFactory()
-       {
-       }
-       
-       virtual Module* CreateModule(InspIRCd* Me)
-       {
-               return new ModuleSSLModes(Me);
-       }
-       
-};
-
+MODULE_INIT(ModuleSSLModes)
 
-extern "C" DllExport void * init_module( void )
-{
-       return new ModuleSSLModesFactory;
-}