7 /* $ModDesc: Provides support for the CHGIDENT command */
11 class cmd_chgident : public command_t
14 cmd_chgident (InspIRCd* Instance) : command_t(Instance,"CHGIDENT", 'o', 2)
16 this->source = "m_chgident.so";
17 syntax = "<nick> <newident>";
20 CmdResult Handle(const char** parameters, int pcnt, userrec *user)
22 userrec* dest = ServerInstance->FindNick(parameters[0]);
26 if(!ServerInstance->IsIdent(parameters[1]))
28 user->WriteServ("NOTICE %s :*** Invalid characters in ident", user->nick);
32 dest->ChangeIdent(parameters[1]);
33 ServerInstance->WriteOpers("%s used CHGIDENT to change %s's ident to '%s'", user->nick, dest->nick, dest->ident);
38 user->WriteServ("401 %s %s :No such nick/channel", user->nick, parameters[0]);
45 class ModuleChgIdent : public Module
47 cmd_chgident* mycommand;
51 ModuleChgIdent(InspIRCd* Me) : Module::Module(Me)
53 mycommand = new cmd_chgident(ServerInstance);
54 ServerInstance->AddCommand(mycommand);
57 virtual ~ModuleChgIdent()
61 virtual Version GetVersion()
63 return Version(1,0,0,0,VF_VENDOR);
68 // stuff down here is the module-factory stuff. For basic modules you can ignore this.
70 class ModuleChgIdentFactory : public ModuleFactory
73 ModuleChgIdentFactory()
77 ~ModuleChgIdentFactory()
81 virtual Module * CreateModule(InspIRCd* Me)
83 return new ModuleChgIdent(Me);
89 extern "C" void * init_module( void )
91 return new ModuleChgIdentFactory;