]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_antibottler.cpp
Moved a ton of functions into helperfuncs.h to speed up recompiles
[user/henk/code/inspircd.git] / src / modules / m_antibottler.cpp
index d6a47fa9044fb714d3f7ef92985a71b4c06b515f..3b57d9d093e7e9d1bd1a583adcef00990187cdd3 100644 (file)
@@ -1,3 +1,19 @@
+/*       +------------------------------------+
+ *       | Inspire Internet Relay Chat Daemon |
+ *       +------------------------------------+
+ *
+ *  Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ *                       E-mail:
+ *                <brain@chatspike.net>
+ *               <Craig@chatspike.net>
+ *     
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ *            the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
 #include "users.h"
 #include "channels.h"
 #include "modules.h"
@@ -22,11 +38,11 @@ class ModuleAntiBottler : public Module
        
        virtual Version GetVersion()
        {
-               return Version(1,0,0,0);
+               return Version(1,0,0,1,VF_VENDOR);
        }
 
 
-       virtual void OnServerRaw(std::string &raw, bool inbound)
+       virtual void OnServerRaw(std::string &raw, bool inbound, userrec* user)
        {
                if (inbound)
                {
@@ -37,18 +53,24 @@ class ModuleAntiBottler : public Module
                        {
                                for (int j = 0; j < strlen(data); j++)
                                {
-                                       if (data[j] = ':')
+                                       if (data[j] == ':')
                                                break;
                                                
-                                       if (data[j] = '"')
+                                       if (data[j] == '"')
                                        {
                                                not_bottler = true;
                                        }
                                }
-                               char *user = strtok(data," ");
+                               // Bug Fix (#14) -- FCS
+                               if (!strlen(data)) return;                              
+                               strtok(data," ");
+                               if (!strlen(data)) return;
                                char *ident = strtok(NULL," ");
+                               if (!strlen(data)) return;
                                char *local = strtok(NULL," ");
+                               if (!strlen(data)) return;
                                char *remote = strtok(NULL," :");
+                               if (!strlen(data)) return;
                                char *gecos = strtok(NULL,"\r\n");
                                for (int j = 0; j < strlen(remote); j++)
                                {