1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2007 InspIRCd Development Team
6 * See: http://www.inspircd.org/wiki/index.php/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
22 /* $ModDesc: Provides support for the SETNAME command */
26 class cmd_setname : public command_t
29 cmd_setname (InspIRCd* Instance) : command_t(Instance,"SETNAME", 0, 1)
31 this->source = "m_setname.so";
32 syntax = "<new-gecos>";
35 CmdResult Handle (const char** parameters, int pcnt, userrec *user)
37 std::string line = "";
38 for (int i = 0; i < pcnt-1; i++)
40 line = line + std::string(parameters[i]) + " ";
42 line = line + std::string(parameters[pcnt-1]);
43 user->ChangeName(line.c_str());
50 class ModuleSetName : public Module
52 cmd_setname* mycommand;
54 ModuleSetName(InspIRCd* Me)
58 mycommand = new cmd_setname(ServerInstance);
59 ServerInstance->AddCommand(mycommand);
62 virtual ~ModuleSetName()
66 virtual Version GetVersion()
68 return Version(1,1,0,1,VF_VENDOR,API_VERSION);
73 // stuff down here is the module-factory stuff. For basic modules you can ignore this.
75 class ModuleSetNameFactory : public ModuleFactory
78 ModuleSetNameFactory()
82 ~ModuleSetNameFactory()
86 virtual Module * CreateModule(InspIRCd* Me)
88 return new ModuleSetName(Me);
94 extern "C" void * init_module( void )
96 return new ModuleSetNameFactory;