5 /* $ModDesc: Provides support for the SETIDENT command */
9 class cmd_setident : public command_t
12 cmd_setident (InspIRCd* Instance) : command_t(Instance,"SETIDENT", 'o', 1)
14 this->source = "m_setident.so";
15 syntax = "<new-ident>";
18 CmdResult Handle(const char** parameters, int pcnt, userrec *user)
21 for(const char* x = parameters[0]; *x; x++, len++)
23 if(((*x >= 'A') && (*x <= '}')) || strchr(".-0123456789", *x))
26 user->WriteServ("NOTICE %s :*** Invalid characters in ident", user->nick);
31 user->WriteServ("NOTICE %s :*** Ident is too long", user->nick);
35 user->ChangeIdent(parameters[0]);
36 ServerInstance->WriteOpers("%s used SETIDENT to change their ident to '%s'", user->nick, user->ident);
43 class ModuleSetIdent : public Module
45 cmd_setident* mycommand;
48 ModuleSetIdent(InspIRCd* Me) : Module::Module(Me)
51 mycommand = new cmd_setident(ServerInstance);
52 ServerInstance->AddCommand(mycommand);
55 virtual ~ModuleSetIdent()
59 virtual Version GetVersion()
61 return Version(1,0,0,0,VF_VENDOR,API_VERSION);
66 // stuff down here is the module-factory stuff. For basic modules you can ignore this.
68 class ModuleSetIdentFactory : public ModuleFactory
71 ModuleSetIdentFactory()
75 ~ModuleSetIdentFactory()
79 virtual Module * CreateModule(InspIRCd* Me)
81 return new ModuleSetIdent(Me);
87 extern "C" void * init_module( void )
89 return new ModuleSetIdentFactory;