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 * ---------------------------------------------------
24 #include "helperfuncs.h"
26 /* $ModDesc: Provides support for the SETNAME command */
30 class cmd_setname : public command_t
33 cmd_setname () : command_t("SETNAME", 0, 1)
35 this->source = "m_setname.so";
38 void Handle (const char** parameters, int pcnt, userrec *user)
40 std::string line = "";
41 for (int i = 0; i < pcnt-1; i++)
43 line = line + std::string(parameters[i]) + " ";
45 line = line + std::string(parameters[pcnt-1]);
46 Srv->ChangeGECOS(user,line);
51 class ModuleSetName : public Module
53 cmd_setname* mycommand;
55 ModuleSetName(Server* Me)
59 mycommand = new cmd_setname();
60 Srv->AddCommand(mycommand);
63 virtual ~ModuleSetName()
67 virtual Version GetVersion()
69 return Version(1,0,0,1,VF_VENDOR);
74 // stuff down here is the module-factory stuff. For basic modules you can ignore this.
76 class ModuleSetNameFactory : public ModuleFactory
79 ModuleSetNameFactory()
83 ~ModuleSetNameFactory()
87 virtual Module * CreateModule(Server* Me)
89 return new ModuleSetName(Me);
95 extern "C" void * init_module( void )
97 return new ModuleSetNameFactory;