]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_nonicks.cpp
Add sanity checks to the ssl modules so that theres no possibility of an out of range...
[user/henk/code/inspircd.git] / src / modules / m_nonicks.cpp
index e7f23e145fc27cb24e2b39530668dd38093dea53..3adc9e160f2630ca5232bdfc758813daa6d93822 100644 (file)
  */
 
 #include "inspircd.h"
-#include "users.h"
-#include "channels.h"
-#include "modules.h"
-#include "hashcomp.h"
-#include "configreader.h"
 
 /* $ModDesc: Provides support for channel mode +N which prevents nick changes on channel */
 
@@ -80,6 +75,9 @@ class ModuleNoNickChange : public Module
        {
                if (IS_LOCAL(user))
                {
+                       if (isdigit(newnick[0])) /* don't even think about touching a switch to uid! */
+                               return 0;
+
                        for (UCListIter i = user->chans.begin(); i != user->chans.end(); i++)
                        {
                                chanrec* curr = i->first;
@@ -99,29 +97,4 @@ class ModuleNoNickChange : public Module
        }
 };
 
-// stuff down here is the module-factory stuff. For basic modules you can ignore this.
-
-class ModuleNoNickChangeFactory : public ModuleFactory
-{
- public:
-       ModuleNoNickChangeFactory()
-       {
-       }
-       
-       ~ModuleNoNickChangeFactory()
-       {
-       }
-       
-       virtual Module * CreateModule(InspIRCd* Me)
-       {
-               return new ModuleNoNickChange(Me);
-       }
-       
-};
-
-
-extern "C" DllExport void * init_module( void )
-{
-       return new ModuleNoNickChangeFactory;
-}
-
+MODULE_INIT(ModuleNoNickChange)