X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_chgname.cpp;h=37c7e9ff8d306525e4c906217849dc46d7f519ee;hb=697098bb47651b40ed9c768361d1a3b1ca452856;hp=a8a85282068b3e6d687f74eef33f9b2b16494f85;hpb=1eb52771d6a7fe8768baf8bad509de0facafbd2c;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_chgname.cpp b/src/modules/m_chgname.cpp index a8a852820..37c7e9ff8 100644 --- a/src/modules/m_chgname.cpp +++ b/src/modules/m_chgname.cpp @@ -26,33 +26,33 @@ class CommandChgname : public Command syntax = " "; TRANSLATE3(TR_NICK, TR_TEXT, TR_END); } - + CmdResult Handle(const std::vector ¶meters, User *user) { User* dest = ServerInstance->FindNick(parameters[0]); if (!dest) { - user->WriteNumeric(401, "%s %s :No such nick/channel", user->nick, parameters[0].c_str()); + user->WriteNumeric(ERR_NOSUCHNICK, "%s %s :No such nick/channel", user->nick.c_str(), parameters[0].c_str()); return CMD_FAILURE; } - + if (parameters[1].empty()) { - user->WriteServ("NOTICE %s :*** GECOS must be specified", user->nick); + user->WriteServ("NOTICE %s :*** GECOS must be specified", user->nick.c_str()); return CMD_FAILURE; } - - if (parameters[1].length() > MAXGECOS) + + if (parameters[1].length() > ServerInstance->Config->Limits.MaxGecos) { - user->WriteServ("NOTICE %s :*** GECOS too long", user->nick); + user->WriteServ("NOTICE %s :*** GECOS too long", user->nick.c_str()); return CMD_FAILURE; } - + if (IS_LOCAL(dest)) { dest->ChangeName(parameters[1].c_str()); - ServerInstance->SNO->WriteToSnoMask('A', "%s used CHGNAME to change %s's real name to '%s'", user->nick, dest->nick, dest->fullname); + ServerInstance->SNO->WriteToSnoMask('A', "%s used CHGNAME to change %s's real name to '%s'", user->nick.c_str(), dest->nick.c_str(), dest->fullname.c_str()); return CMD_LOCALONLY; /* name change routed by FNAME in spanningtree now */ } @@ -65,8 +65,8 @@ class CommandChgname : public Command class ModuleChgName : public Module { CommandChgname* mycommand; - - + + public: ModuleChgName(InspIRCd* Me) : Module(Me) { @@ -74,16 +74,16 @@ public: ServerInstance->AddCommand(mycommand); } - + virtual ~ModuleChgName() { } - + virtual Version GetVersion() { - return Version(1, 2, 0, 0, VF_COMMON | VF_VENDOR, API_VERSION); + return Version("$Id$", VF_COMMON | VF_VENDOR, API_VERSION); } - + }; MODULE_INIT(ModuleChgName)