summaryrefslogtreecommitdiff
path: root/src/modules/m_setname.cpp
diff options
context:
space:
mode:
authorspecial <special@e03df62e-2008-0410-955e-edbf42e46eb7>2007-06-26 06:33:41 +0000
committerspecial <special@e03df62e-2008-0410-955e-edbf42e46eb7>2007-06-26 06:33:41 +0000
commite4c1ae81efcfce5d5105c49bbb17356496e67ff1 (patch)
tree2fbb5c1bf9124f4dd072c7faf6d8ac18de145881 /src/modules/m_setname.cpp
parentee6208dc8f5bb806eca36e230ca5bbb6d5a45f60 (diff)
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
Diffstat (limited to 'src/modules/m_setname.cpp')
-rw-r--r--src/modules/m_setname.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/modules/m_setname.cpp b/src/modules/m_setname.cpp
index 3ececbbb3..ecf0d41a9 100644
--- a/src/modules/m_setname.cpp
+++ b/src/modules/m_setname.cpp
@@ -31,19 +31,23 @@ class cmd_setname : public command_t
CmdResult Handle (const char** parameters, int pcnt, userrec *user)
{
- std::string line;
- for (int i = 0; i < pcnt-1; i++)
+ if (!*parameters[0])
{
- line = line + std::string(parameters[i]) + " ";
+ user->WriteServ("NOTICE %s :*** SETNAME: GECOS must be specified", user->nick);
+ return CMD_FAILURE;
}
- line = line + std::string(parameters[pcnt-1]);
- if (line.length() == 0)
+ if (strlen(parameters[0]) > MAXGECOS)
{
- user->WriteServ("NOTICE %s :*** GECOS too short", user->nick);
+ user->WriteServ("NOTICE %s :*** SETNAME: GECOS too long", user->nick);
return CMD_FAILURE;
}
- user->ChangeName(line.c_str());
+
+ if (user->ChangeName(parameters[0]))
+ {
+ ServerInstance->WriteOpers("%s used SETNAME to change their GECOS to %s", user->nick, parameters[0]);
+ return CMD_SUCCESS;
+ }
return CMD_SUCCESS;
}