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 void 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 ServerInstance->WriteOpers("%s used CHGIDENT to change %s's ident from '%s' to '%s'", user->nick, dest->nick, dest->ident, parameters[1]);
33 strlcpy(dest->ident, parameters[1], IDENTMAX+2);
37 user->WriteServ("401 %s %s :No such nick/channel", user->nick, parameters[0]);
43 class ModuleChgIdent : public Module
45 cmd_chgident* mycommand;
49 ModuleChgIdent(InspIRCd* Me) : Module::Module(Me)
51 mycommand = new cmd_chgident(ServerInstance);
52 ServerInstance->AddCommand(mycommand);
55 virtual ~ModuleChgIdent()
59 virtual Version GetVersion()
61 return Version(1,0,0,0,VF_VENDOR);
66 // stuff down here is the module-factory stuff. For basic modules you can ignore this.
68 class ModuleChgIdentFactory : public ModuleFactory
71 ModuleChgIdentFactory()
75 ~ModuleChgIdentFactory()
79 virtual Module * CreateModule(InspIRCd* Me)
81 return new ModuleChgIdent(Me);
87 extern "C" void * init_module( void )
89 return new ModuleChgIdentFactory;