1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2009 InspIRCd Development Team
6 * See: http://wiki.inspircd.org/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 CommandSetname : public Command
23 CommandSetname (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator,"SETNAME", 0, 1, 1)
25 syntax = "<new-gecos>";
26 TRANSLATE2(TR_TEXT, TR_END);
29 CmdResult Handle (const std::vector<std::string>& parameters, User *user)
31 if (parameters.size() == 0)
33 user->WriteServ("NOTICE %s :*** SETNAME: GECOS must be specified", user->nick.c_str());
37 if (parameters[0].size() > ServerInstance->Config->Limits.MaxGecos)
39 user->WriteServ("NOTICE %s :*** SETNAME: GECOS too long", user->nick.c_str());
43 if (user->ChangeName(parameters[0].c_str()))
45 ServerInstance->SNO->WriteGlobalSno('a', "%s used SETNAME to change their GECOS to %s", user->nick.c_str(), parameters[0].c_str());
54 class ModuleSetName : public Module
58 ModuleSetName(InspIRCd* Me)
59 : Module(Me), cmd(Me, this)
61 ServerInstance->AddCommand(&cmd);
64 virtual ~ModuleSetName()
68 virtual Version GetVersion()
70 return Version("$Id$", VF_VENDOR, API_VERSION);
74 MODULE_INIT(ModuleSetName)