From e4c1ae81efcfce5d5105c49bbb17356496e67ff1 Mon Sep 17 00:00:00 2001 From: special Date: Tue, 26 Jun 2007 06:33:41 +0000 Subject: Made all of the error messages in chg* and set* a bit more uniform, and added a few that were missing git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7413 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_setident.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'src/modules/m_setident.cpp') diff --git a/src/modules/m_setident.cpp b/src/modules/m_setident.cpp index a98592299..97ed80496 100644 --- a/src/modules/m_setident.cpp +++ b/src/modules/m_setident.cpp @@ -30,26 +30,24 @@ class cmd_setident : public command_t CmdResult Handle(const char** parameters, int pcnt, userrec *user) { - size_t len = 0; - for(const char* x = parameters[0]; *x; x++, len++) + if (!*parameters[0]) { - if(((*x >= 'A') && (*x <= '}')) || strchr(".-0123456789", *x)) - continue; - - user->WriteServ("NOTICE %s :*** Invalid characters in ident", user->nick); + user->WriteServ("NOTICE %s :*** SETIDENT: Ident must be specified", user->nick); return CMD_FAILURE; } - if (len == 0) + + if (strlen(parameters[0]) > IDENTMAX) { - user->WriteServ("NOTICE %s :*** SETIDENT: Ident too short", user->nick); + user->WriteServ("NOTICE %s :*** SETIDENT: Ident is too long", user->nick); return CMD_FAILURE; } - if (len > IDENTMAX) + + if (!ServerInstance->IsIdent(parameters[0])) { - user->WriteServ("NOTICE %s :*** Ident is too long", user->nick); + user->WriteServ("NOTICE %s :*** SETIDENT: Invalid characters in ident", user->nick); return CMD_FAILURE; } - + user->ChangeIdent(parameters[0]); ServerInstance->WriteOpers("%s used SETIDENT to change their ident to '%s'", user->nick, user->ident); -- cgit v1.3.1-10-gc9f91