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) : Command(Instance,"SETNAME", 0, 1, 1)
25 this->source = "m_setname.so";
26 syntax = "<new-gecos>";
27 TRANSLATE2(TR_TEXT, TR_END);
30 CmdResult Handle (const std::vector<std::string>& parameters, User *user)
32 if (parameters.size() == 0)
34 user->WriteServ("NOTICE %s :*** SETNAME: GECOS must be specified", user->nick.c_str());
38 if (parameters[0].size() > ServerInstance->Config->Limits.MaxGecos)
40 user->WriteServ("NOTICE %s :*** SETNAME: GECOS too long", user->nick.c_str());
44 if (user->ChangeName(parameters[0].c_str()))
46 ServerInstance->SNO->WriteGlobalSno('a', "%s used SETNAME to change their GECOS to %s", user->nick.c_str(), parameters[0].c_str());
55 class ModuleSetName : public Module
57 CommandSetname* mycommand;
59 ModuleSetName(InspIRCd* Me)
63 mycommand = new CommandSetname(ServerInstance);
64 ServerInstance->AddCommand(mycommand);
68 virtual ~ModuleSetName()
72 virtual Version GetVersion()
74 return Version("$Id$", VF_VENDOR, API_VERSION);
78 MODULE_INIT(ModuleSetName)