X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_chgident.cpp;h=6ddda7ea113d5601895e02ba22b9b83aec3913df;hb=1041cb9329027ea2b3855836e2bb68ab7411730f;hp=1c3bf53d3ea8e5d104439383fc138855e081bb93;hpb=23e8bba13c55d33ce89d505780da36c9589e300a;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_chgident.cpp b/src/modules/m_chgident.cpp index 1c3bf53d3..6ddda7ea1 100644 --- a/src/modules/m_chgident.cpp +++ b/src/modules/m_chgident.cpp @@ -22,8 +22,6 @@ #include "inspircd.h" -/* $ModDesc: Provides support for the CHGIDENT command */ - /** Handle /CHGIDENT */ class CommandChgident : public Command @@ -33,17 +31,17 @@ class CommandChgident : public Command { allow_empty_last_param = false; flags_needed = 'o'; - syntax = " "; - TRANSLATE3(TR_NICK, TR_TEXT, TR_END); + syntax = " "; + TRANSLATE2(TR_NICK, TR_TEXT); } - CmdResult Handle(const std::vector ¶meters, User *user) + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { User* dest = ServerInstance->FindNick(parameters[0]); 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; } @@ -53,7 +51,7 @@ class CommandChgident : public Command return CMD_FAILURE; } - if (!ServerInstance->IsIdent(parameters[1].c_str())) + if (!ServerInstance->IsIdent(parameters[1])) { user->WriteNotice("*** CHGIDENT: Invalid characters in ident"); return CMD_FAILURE; @@ -61,21 +59,18 @@ class CommandChgident : public Command if (IS_LOCAL(dest)) { - dest->ChangeIdent(parameters[1].c_str()); + dest->ChangeIdent(parameters[1]); - if (!ServerInstance->ULine(user->server)) + if (!user->server->IsULine()) ServerInstance->SNO->WriteGlobalSno('a', "%s used CHGIDENT to change %s's ident to '%s'", user->nick.c_str(), dest->nick.c_str(), dest->ident.c_str()); } return CMD_SUCCESS; } - RouteDescriptor GetRouting(User* user, const std::vector& parameters) + RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE { - User* dest = ServerInstance->FindNick(parameters[0]); - if (dest) - return ROUTE_OPT_UCAST(dest->server); - return ROUTE_LOCALONLY; + return ROUTE_OPT_UCAST(parameters[0]); } }; @@ -88,16 +83,10 @@ public: { } - void init() - { - ServerInstance->Modules->AddService(cmd); - } - - virtual Version GetVersion() + Version GetVersion() CXX11_OVERRIDE { return Version("Provides support for the CHGIDENT command", VF_OPTCOMMON | VF_VENDOR); } - }; MODULE_INIT(ModuleChgIdent)