X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_sanick.cpp;h=c9ceba78ee3d2fbf7058304ed508696c533840ce;hb=a4508da82cb17120c04f697d6c63660cd697284b;hp=01899dd0add2b31e746c451b1313287898080162;hpb=5c9427cde0a949a17a476311db0a2a275345337b;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_sanick.cpp b/src/modules/m_sanick.cpp index 01899dd0a..c9ceba78e 100644 --- a/src/modules/m_sanick.cpp +++ b/src/modules/m_sanick.cpp @@ -21,8 +21,6 @@ #include "inspircd.h" -/* $ModDesc: Provides support for SANICK command */ - /** Handle /SANICK */ class CommandSanick : public Command @@ -31,8 +29,8 @@ class CommandSanick : public Command CommandSanick(Module* Creator) : Command(Creator,"SANICK", 2) { allow_empty_last_param = false; - flags_needed = 'o'; Penalty = 0; syntax = " "; - TRANSLATE3(TR_NICK, TR_TEXT, TR_END); + flags_needed = 'o'; syntax = " "; + TRANSLATE2(TR_NICK, TR_TEXT); } CmdResult Handle (const std::vector& parameters, User *user) @@ -42,9 +40,9 @@ class CommandSanick : public Command /* Do local sanity checks and bails */ if (IS_LOCAL(user)) { - if (target && ServerInstance->ULine(target->server)) + if (target && target->server->IsULine()) { - user->WriteNumeric(ERR_NOPRIVILEGES, "%s :Cannot use an SA command on a u-lined client",user->nick.c_str()); + user->WriteNumeric(ERR_NOPRIVILEGES, "Cannot use an SA command on a u-lined client"); return CMD_FAILURE; } @@ -66,7 +64,7 @@ class CommandSanick : public Command { std::string oldnick = user->nick; std::string newnick = target->nick; - if (target->ChangeNick(parameters[1], true)) + if (target->ChangeNick(parameters[1])) { ServerInstance->SNO->WriteGlobalSno('a', oldnick+" used SANICK to change "+newnick+" to "+parameters[1]); } @@ -81,10 +79,7 @@ class CommandSanick : 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]); } }; @@ -98,11 +93,6 @@ class ModuleSanick : public Module { } - void init() CXX11_OVERRIDE - { - ServerInstance->Modules->AddService(cmd); - } - Version GetVersion() CXX11_OVERRIDE { return Version("Provides support for SANICK command", VF_OPTCOMMON | VF_VENDOR); @@ -110,4 +100,3 @@ class ModuleSanick : public Module }; MODULE_INIT(ModuleSanick) -