1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2008 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 SETIDENT command */
20 class CommandSetident : public Command
23 CommandSetident (InspIRCd* Instance) : Command(Instance,"SETIDENT", "o", 1)
25 this->source = "m_setident.so";
26 syntax = "<new-ident>";
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 :*** SETIDENT: Ident must be specified", user->nick.c_str());
38 if (parameters[0].size() > ServerInstance->Config->Limits.IdentMax)
40 user->WriteServ("NOTICE %s :*** SETIDENT: Ident is too long", user->nick.c_str());
44 if (!ServerInstance->IsIdent(parameters[0].c_str()))
46 user->WriteServ("NOTICE %s :*** SETIDENT: Invalid characters in ident", user->nick.c_str());
50 user->ChangeIdent(parameters[0].c_str());
51 ServerInstance->SNO->WriteToSnoMask('A', "%s used SETIDENT to change their ident to '%s'", user->nick.c_str(), user->ident.c_str());
58 class ModuleSetIdent : public Module
60 CommandSetident* mycommand;
63 ModuleSetIdent(InspIRCd* Me) : Module(Me)
66 mycommand = new CommandSetident(ServerInstance);
67 ServerInstance->AddCommand(mycommand);
71 virtual ~ModuleSetIdent()
75 virtual Version GetVersion()
77 return Version("$Id$", VF_COMMON | VF_VENDOR, API_VERSION);
83 MODULE_INIT(ModuleSetIdent)