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 * ---------------------------------------------------
19 /* $ModDesc: Provides support for the SETNAME command */
23 class cmd_setname : public command_t
26 cmd_setname (InspIRCd* Instance) : command_t(Instance,"SETNAME", 0, 1)
28 this->source = "m_setname.so";
29 syntax = "<new-gecos>";
32 CmdResult Handle (const char** parameters, int pcnt, userrec *user)
34 std::string line = "";
35 for (int i = 0; i < pcnt-1; i++)
37 line = line + std::string(parameters[i]) + " ";
39 line = line + std::string(parameters[pcnt-1]);
40 user->ChangeName(line.c_str());
47 class ModuleSetName : public Module
49 cmd_setname* mycommand;
51 ModuleSetName(InspIRCd* Me)
55 mycommand = new cmd_setname(ServerInstance);
56 ServerInstance->AddCommand(mycommand);
59 virtual ~ModuleSetName()
63 virtual Version GetVersion()
65 return Version(1,1,0,1,VF_VENDOR,API_VERSION);
70 // stuff down here is the module-factory stuff. For basic modules you can ignore this.
72 class ModuleSetNameFactory : public ModuleFactory
75 ModuleSetNameFactory()
79 ~ModuleSetNameFactory()
83 virtual Module * CreateModule(InspIRCd* Me)
85 return new ModuleSetName(Me);
91 extern "C" DllExport void * init_module( void )
93 return new ModuleSetNameFactory;