]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_conn_umodes.cpp
Fix potential for duplicate SID if the SID is auto generated.
[user/henk/code/inspircd.git] / src / modules / m_conn_umodes.cpp
index cfed84c45c829e7562a31dfe1ec9745fbae9a6fd..23b5d82803ae57e452e8f48b11d106b4bcb58a71 100644 (file)
  * ---------------------------------------------------
  */
 
-#include <stdio.h>
-#include <vector>
-#include "users.h"
-#include "channels.h"
 #include "inspircd.h"
-#include "modules.h"
 #include "wildcard.h"
 
 /* $ModDesc: Sets (and unsets) modes on users when they connect */
@@ -67,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);
@@ -103,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)