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 void 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());
53 class ModuleSetName : public Module
55 cmd_setname* mycommand;
57 ModuleSetName(InspIRCd* Me)
61 mycommand = new cmd_setname(ServerInstance);
62 ServerInstance->AddCommand(mycommand);
65 virtual ~ModuleSetName()
69 virtual Version GetVersion()
71 return Version(1,0,0,1,VF_VENDOR);
76 // stuff down here is the module-factory stuff. For basic modules you can ignore this.
78 class ModuleSetNameFactory : public ModuleFactory
81 ModuleSetNameFactory()
85 ~ModuleSetNameFactory()
89 virtual Module * CreateModule(InspIRCd* Me)
91 return new ModuleSetName(Me);
97 extern "C" void * init_module( void )
99 return new ModuleSetNameFactory;