1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * Inspire is copyright (C) 2002-2004 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
35 virtual ~ModuleAntiBottler()
40 virtual Version GetVersion()
42 return Version(1,0,0,1,VF_VENDOR);
46 virtual void OnServerRaw(std::string &raw, bool inbound, userrec* user)
51 strncpy(data,raw.c_str(),MAXBUF);
52 bool not_bottler = false;
53 if (!strncmp(data,"user ",5))
55 for (unsigned int j = 0; j < strlen(data); j++)
65 // Bug Fix (#14) -- FCS
66 if (!strlen(data)) return;
68 if (!strlen(data)) return;
69 char *ident = strtok(NULL," ");
70 if (!strlen(data)) return;
71 char *local = strtok(NULL," ");
72 if (!strlen(data)) return;
73 char *remote = strtok(NULL," :");
74 if (!strlen(data)) return;
75 char *gecos = strtok(NULL,"\r\n");
76 for (unsigned int j = 0; j < strlen(remote); j++)
78 if (((remote[j] < '0') || (remote[j] > '9')) && (remote[j] != '.'))
86 raw = "USER bottler "+std::string(local)+" "+std::string(remote)+" "+std::string(gecos)+" [Possible bottler, ident: "+std::string(ident)+"]";
94 class ModuleAntiBottlerFactory : public ModuleFactory
97 ModuleAntiBottlerFactory()
101 ~ModuleAntiBottlerFactory()
105 virtual Module * CreateModule()
107 return new ModuleAntiBottler;
113 extern "C" void * init_module( void )
115 return new ModuleAntiBottlerFactory;