X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_antibottler.cpp;h=9c7d75ea26dd971e089d645fb06775a366473374;hb=d54fd9b1e6b31f69332a9241b5f17330c0ad61e0;hp=8d588cf5c8a1d863194e35ba69a66e6a2711af30;hpb=1f1258997c2d63eb54c5addece622af37f637a7b;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_antibottler.cpp b/src/modules/m_antibottler.cpp index 8d588cf5c..9c7d75ea2 100644 --- a/src/modules/m_antibottler.cpp +++ b/src/modules/m_antibottler.cpp @@ -2,7 +2,7 @@ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * - * Inspire is copyright (C) 2002-2004 ChatSpike-Dev. + * InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev. * E-mail: * * @@ -23,15 +23,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() { @@ -47,7 +50,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 +69,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 +107,7 @@ class ModuleAntiBottlerFactory : public ModuleFactory { } - virtual Module * CreateModule(Server* Me) + virtual Module * CreateModule(InspIRCd* Me) { return new ModuleAntiBottler(Me); }