2 * SETNAME module for InspIRCD
6 * Syntax: /SETNAME [new name]
7 * Changes the user's GECOS who issues the command
17 /* $ModDesc: Provides support for the SETNAME command */
21 void handle_setname(char **parameters, int pcnt, userrec *user)
23 std::string line = "";
24 for (int i = 0; i < pcnt-1; i++)
26 line = line + std::string(parameters[i]);
28 line = line + std::string(parameters[pcnt-1]);
29 Srv->ChangeGECOS(user,line);
33 class ModuleSetName : public Module
39 Srv->AddCommand("SETNAME",handle_setname,0,1);
42 virtual ~ModuleSetName()
47 virtual Version GetVersion()
49 return Version(1,0,0,0);
54 // stuff down here is the module-factory stuff. For basic modules you can ignore this.
56 class ModuleSetNameFactory : public ModuleFactory
59 ModuleSetNameFactory()
63 ~ModuleSetNameFactory()
67 virtual Module * CreateModule()
69 return new ModuleSetName;
75 extern "C" void * init_module( void )
77 return new ModuleSetNameFactory;