5 /* $ModDesc: Provides support for the SETIDENT command */
7 class cmd_setident : public command_t
10 cmd_setident (InspIRCd* Instance) : command_t(Instance,"SETIDENT", 'o', 1)
12 this->source = "m_setident.so";
13 syntax = "<new-ident>";
16 CmdResult Handle(const char** parameters, int pcnt, userrec *user)
19 for(const char* x = parameters[0]; *x; x++, len++)
21 if(((*x >= 'A') && (*x <= '}')) || strchr(".-0123456789", *x))
24 user->WriteServ("NOTICE %s :*** Invalid characters in ident", user->nick);
29 user->WriteServ("NOTICE %s :*** Ident is too long", user->nick);
33 user->ChangeIdent(parameters[0]);
34 ServerInstance->WriteOpers("%s used SETIDENT to change their ident to '%s'", user->nick, user->ident);
41 class ModuleSetIdent : public Module
43 cmd_setident* mycommand;
46 ModuleSetIdent(InspIRCd* Me) : Module::Module(Me)
49 mycommand = new cmd_setident(ServerInstance);
50 ServerInstance->AddCommand(mycommand);
53 virtual ~ModuleSetIdent()
57 virtual Version GetVersion()
59 return Version(1,0,0,0,VF_VENDOR,API_VERSION);
64 // stuff down here is the module-factory stuff. For basic modules you can ignore this.
66 class ModuleSetIdentFactory : public ModuleFactory
69 ModuleSetIdentFactory()
73 ~ModuleSetIdentFactory()
77 virtual Module * CreateModule(InspIRCd* Me)
79 return new ModuleSetIdent(Me);
85 extern "C" void * init_module( void )
87 return new ModuleSetIdentFactory;