1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
7 * <brain@chatspike.net>
8 * <Craig@chatspike.net>
10 * Written by Craig Edwards, Craig McLure, and others.
11 * This program is free but copyrighted software; see
12 * the file COPYING for details.
14 * ---------------------------------------------------
22 /* $ModDesc: Changes the ident of connecting bottler clients to 'bottler' */
24 class ModuleAntiBottler : public Module
27 ModuleAntiBottler(InspIRCd* Me)
33 void Implements(char* List)
35 List[I_OnServerRaw] = 1;
39 virtual ~ModuleAntiBottler()
43 virtual Version GetVersion()
45 return Version(1,0,0,1,VF_VENDOR);
48 virtual void OnServerRaw(std::string &raw, bool inbound, userrec* user)
53 strlcpy(data,raw.c_str(),MAXBUF);
54 bool not_bottler = false;
55 if (!strncmp(data,"user ",5))
57 for (char* j = data; *j; j++)
67 // Bug Fix (#14) -- FCS
69 if (!(data) || !(*data))
73 char *ident = strtok(NULL," ");
74 char *local = strtok(NULL," ");
75 char *remote = strtok(NULL," :");
76 char *gecos = strtok(NULL,"\r\n");
78 if (!ident || !local || !remote || !gecos)
81 for (char* j = remote; *j; j++)
83 if (((*j < '0') || (*j > '9')) && (*j != '.'))
91 raw = "USER bottler "+std::string(local)+" "+std::string(remote)+" "+std::string(gecos)+" [Possible bottler, ident: "+std::string(ident)+"]";
99 class ModuleAntiBottlerFactory : public ModuleFactory
102 ModuleAntiBottlerFactory()
106 ~ModuleAntiBottlerFactory()
110 virtual Module * CreateModule(InspIRCd* Me)
112 return new ModuleAntiBottler(Me);
118 extern "C" void * init_module( void )
120 return new ModuleAntiBottlerFactory;