]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_conn_umodes.cpp
In the grand tradition of huge fucking commits:
[user/henk/code/inspircd.git] / src / modules / m_conn_umodes.cpp
index d880853adcbfcc6edf7e622df8cd817bc28cd776..34e1fd34df15c591f1ff43fc8dd7898c6771e622 100644 (file)
@@ -12,9 +12,6 @@
  */
 
 #include "inspircd.h"
-#include "users.h"
-#include "channels.h"
-#include "modules.h"
 #include "wildcard.h"
 
 /* $ModDesc: Sets (and unsets) modes on users when they connect */
@@ -38,7 +35,7 @@ class ModuleModesOnConnect : public Module
                List[I_OnPostConnect] = List[I_OnRehash] = 1;
        }
 
-       virtual void OnRehash(userrec* user, const std::string &parameter)
+       virtual void OnRehash(User* user, const std::string &parameter)
        {
                DELETE(Conf);
                Conf = new ConfigReader(ServerInstance);
@@ -54,7 +51,7 @@ class ModuleModesOnConnect : public Module
                return Version(1,1,0,1,VF_VENDOR,API_VERSION);
        }
        
-       virtual void OnPostConnect(userrec* user)
+       virtual void OnPostConnect(User* user)
        {
                if (!IS_LOCAL(user))
                        return;
@@ -65,7 +62,7 @@ class ModuleModesOnConnect : public Module
                        if ((match(user->GetIPString(),hostn.c_str(),true)) || (match(user->host,hostn.c_str())))
                        {
                                std::string ThisModes = Conf->ReadValue("connect","modes",j);
-                               if (ThisModes != "")
+                               if (!ThisModes.empty())
                                {
                                        std::string buf;
                                        stringstream ss(ThisModes);
@@ -101,29 +98,4 @@ class ModuleModesOnConnect : public Module
        }
 };
 
-// stuff down here is the module-factory stuff. For basic modules you can ignore this.
-
-class ModuleModesOnConnectFactory : public ModuleFactory
-{
- public:
-       ModuleModesOnConnectFactory()
-       {
-       }
-       
-       ~ModuleModesOnConnectFactory()
-       {
-       }
-       
-       virtual Module * CreateModule(InspIRCd* Me)
-       {
-               return new ModuleModesOnConnect(Me);
-       }
-       
-};
-
-
-extern "C" DllExport void * init_module( void )
-{
-       return new ModuleModesOnConnectFactory;
-}
-
+MODULE_INIT(ModuleModesOnConnect)