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 * ---------------------------------------------------
27 /* $ModDesc: Provides support for the SETNAME command */
31 class cmd_setname : public command_t
34 cmd_setname (InspIRCd* Instance) : command_t(Instance,"SETNAME", 0, 1)
36 this->source = "m_setname.so";
37 syntax = "<new-gecos>";
40 CmdResult Handle (const char** parameters, int pcnt, userrec *user)
42 std::string line = "";
43 for (int i = 0; i < pcnt-1; i++)
45 line = line + std::string(parameters[i]) + " ";
47 line = line + std::string(parameters[pcnt-1]);
48 user->ChangeName(line.c_str());
55 class ModuleSetName : public Module
57 cmd_setname* mycommand;
59 ModuleSetName(InspIRCd* Me)
63 mycommand = new cmd_setname(ServerInstance);
64 ServerInstance->AddCommand(mycommand);
67 virtual ~ModuleSetName()
71 virtual Version GetVersion()
73 return Version(1,1,0,1,VF_VENDOR,API_VERSION);
78 // stuff down here is the module-factory stuff. For basic modules you can ignore this.
80 class ModuleSetNameFactory : public ModuleFactory
83 ModuleSetNameFactory()
87 ~ModuleSetNameFactory()
91 virtual Module * CreateModule(InspIRCd* Me)
93 return new ModuleSetName(Me);
99 extern "C" void * init_module( void )
101 return new ModuleSetNameFactory;