X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_chgname.cpp;h=2582ef6520f67f27722438f96ed670156b370117;hb=451e687f681ccab5c02a8de1a7d59b324efbfe08;hp=5214478423360edc80f617c7b2f2fbeaffc600b0;hpb=c25a59d9036444872d831a126c6326f3d8be5e74;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_chgname.cpp b/src/modules/m_chgname.cpp index 521447842..2582ef652 100644 --- a/src/modules/m_chgname.cpp +++ b/src/modules/m_chgname.cpp @@ -20,8 +20,6 @@ #include "inspircd.h" -/* $ModDesc: Provides support for the CHGNAME command */ - /** Handle /CHGNAME */ class CommandChgname : public Command @@ -41,7 +39,7 @@ class CommandChgname : public Command if ((!dest) || (dest->registered != REG_ALL)) { - user->WriteNumeric(ERR_NOSUCHNICK, "%s %s :No such nick/channel", user->nick.c_str(), parameters[0].c_str()); + user->WriteNumeric(Numerics::NoSuchNick(parameters[0])); return CMD_FAILURE; } @@ -59,7 +57,7 @@ class CommandChgname : public Command if (IS_LOCAL(dest)) { - dest->ChangeName(parameters[1].c_str()); + dest->ChangeName(parameters[1]); ServerInstance->SNO->WriteGlobalSno('a', "%s used CHGNAME to change %s's GECOS to '%s'", user->nick.c_str(), dest->nick.c_str(), dest->fullname.c_str()); } @@ -68,10 +66,7 @@ class CommandChgname : public Command RouteDescriptor GetRouting(User* user, const std::vector& parameters) { - User* dest = ServerInstance->FindNick(parameters[0]); - if (dest) - return ROUTE_OPT_UCAST(dest->server); - return ROUTE_LOCALONLY; + return ROUTE_OPT_UCAST(parameters[0]); } }; @@ -84,16 +79,10 @@ public: { } - void init() CXX11_OVERRIDE - { - ServerInstance->Modules->AddService(cmd); - } - Version GetVersion() CXX11_OVERRIDE { return Version("Provides support for the CHGNAME command", VF_OPTCOMMON | VF_VENDOR); } - }; MODULE_INIT(ModuleChgName)