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 * ---------------------------------------------------
16 /* $ModDesc: Provides support for the SETNAME command */
20 class cmd_setname : public command_t
23 cmd_setname (InspIRCd* Instance) : command_t(Instance,"SETNAME", 0, 1)
25 this->source = "m_setname.so";
26 syntax = "<new-gecos>";
27 TRANSLATE2(TR_TEXT, TR_END);
30 CmdResult Handle (const char** parameters, int pcnt, userrec *user)
34 user->WriteServ("NOTICE %s :*** SETNAME: GECOS must be specified", user->nick);
38 if (strlen(parameters[0]) > MAXGECOS)
40 user->WriteServ("NOTICE %s :*** SETNAME: GECOS too long", user->nick);
44 if (user->ChangeName(parameters[0]))
46 ServerInstance->WriteOpers("%s used SETNAME to change their GECOS to %s", user->nick, parameters[0]);
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_COMMON | VF_VENDOR, API_VERSION);
78 MODULE_INIT(ModuleSetName)