X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_chgident.cpp;h=1f7c28ddaa82fb6b261cf1c9bbdd69fcc3850964;hb=9dd72b7003963d868a23da930a91300b49ab4959;hp=52bfd237cfe9f0fa61043470935d5ebfe9d3895a;hpb=15314fa27a558a93f7aa7c1e32c6e4e9b4b4628b;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_chgident.cpp b/src/modules/m_chgident.cpp index 52bfd237c..1f7c28dda 100644 --- a/src/modules/m_chgident.cpp +++ b/src/modules/m_chgident.cpp @@ -1,19 +1,19 @@ #include #include "users.h" #include "modules.h" +#include "message.h" #include "helperfuncs.h" /* $ModDesc: Provides support for the CHGIDENT command */ -Server *Srv; - - class cmd_chgident : public command_t { + Server* Srv; public: - cmd_chgident() : command_t("CHGIDENT", 'o', 2) + cmd_chgident(Server* serv) : command_t("CHGIDENT", 'o', 2) { this->source = "m_chgident.so"; + Srv = serv; } void Handle(char **parameters, int pcnt, userrec *user) @@ -22,11 +22,8 @@ class cmd_chgident : public command_t if(dest) { - for(unsigned int x = 0; x < strlen(parameters[1]); x++) + if(!isident(parameters[1])) { - if(((parameters[1][x] >= 'A') && (parameters[1][x] <= '}')) || strchr(".-0123456789", parameters[1][x])) - continue; - WriteServ(user->fd, "NOTICE %s :*** Invalid characters in ident", user->nick); return; } @@ -49,9 +46,8 @@ class ModuleChgIdent : public Module public: ModuleChgIdent(Server* Me) : Module::Module(Me) { - Srv = Me; - mycommand = new cmd_chgident(); - Srv->AddCommand(mycommand); + mycommand = new cmd_chgident(Me); + Me->AddCommand(mycommand); } virtual ~ModuleChgIdent()