]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_antibottler.cpp
To be more specific, specify rpath() macro here
[user/henk/code/inspircd.git] / src / modules / m_antibottler.cpp
index 8d588cf5c8a1d863194e35ba69a66e6a2711af30..0e80809d725a4d5fe338494defeb26935e8642af 100644 (file)
@@ -2,18 +2,14 @@
  *       | 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.
+ *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ * See: http://www.inspircd.org/wiki/index.php/Credits
+ *
  * This program is free but copyrighted software; see
  *            the file COPYING for details.
  *
  * ---------------------------------------------------
  */
-using namespace std;
 
 #include "users.h"
 #include "channels.h"
@@ -23,15 +19,18 @@ using namespace std;
 
 class ModuleAntiBottler : public Module
 {
- private:
-        
-        Server *Srv;
  public:
-       ModuleAntiBottler(Server* Me)
+       ModuleAntiBottler(InspIRCd* Me)
                : Module::Module(Me)
        {
-               Srv = Me;
+               
        }
+
+       void Implements(char* List)
+       {
+               List[I_OnServerRaw] = 1;
+       }
+
        
        virtual ~ModuleAntiBottler()
        {
@@ -39,7 +38,7 @@ class ModuleAntiBottler : public Module
        
        virtual Version GetVersion()
        {
-               return Version(1,0,0,1,VF_VENDOR);
+               return Version(1,1,0,1,VF_VENDOR,API_VERSION);
        }
 
        virtual void OnServerRaw(std::string &raw, bool inbound, userrec* user)
@@ -47,7 +46,7 @@ class ModuleAntiBottler : public Module
                if (inbound)
                {
                        char data[MAXBUF];
-                       strncpy(data,raw.c_str(),MAXBUF);
+                       strlcpy(data,raw.c_str(),MAXBUF);
                        bool not_bottler = false;
                        if (!strncmp(data,"user ",5))
                        {
@@ -66,11 +65,6 @@ class ModuleAntiBottler : public Module
                                if (!(data) || !(*data))
                                        return;
 
-                               /*
-                                * slight efficiency fix: strtok() just returns NULL if it has no more
-                                * tokens to return. Plus strlen's here really could have been replaced
-                                * with above pointer voodoo :-). --w00t
-                                */
                                strtok(data," ");
                                char *ident = strtok(NULL," ");
                                char *local = strtok(NULL," ");
@@ -109,7 +103,7 @@ class ModuleAntiBottlerFactory : public ModuleFactory
        {
        }
        
-       virtual Module * CreateModule(Server* Me)
+       virtual Module * CreateModule(InspIRCd* Me)
        {
                return new ModuleAntiBottler(Me);
        }