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 * ---------------------------------------------------
18 /* $ModDesc: Provides support for the CHGNAME command */
22 class cmd_chgname : public command_t
25 cmd_chgname (InspIRCd* Instance) : command_t(Instance,"CHGNAME", 'o', 2)
27 this->source = "m_chgname.so";
28 syntax = "<nick> <newname>";
31 CmdResult Handle(const char** parameters, int pcnt, userrec *user)
33 userrec* dest = ServerInstance->FindNick(parameters[0]);
37 user->WriteServ("401 %s %s :No such nick/channel", user->nick, parameters[0]);
43 dest->ChangeName(parameters[1]);
44 ServerInstance->WriteOpers("%s used CHGNAME to change %s's real name to '%s'", user->nick, dest->nick, dest->fullname);
45 return CMD_LOCALONLY; /* name change routed by FNAME in spanningtree now */
54 class ModuleChgName : public Module
56 cmd_chgname* mycommand;
60 ModuleChgName(InspIRCd* Me) : Module(Me)
62 mycommand = new cmd_chgname(ServerInstance);
63 ServerInstance->AddCommand(mycommand);
66 virtual ~ModuleChgName()
70 virtual Version GetVersion()
72 return Version(1,1,0,0,VF_VENDOR,API_VERSION);
77 MODULE_INIT(ModuleChgName);