X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_saquit.cpp;h=c3895ec12f22384fbe28625f1d1ed02106e8a725;hb=fb66fb5ce3410d7e32813aed85e8ad3050584740;hp=b7466048795668240c2363798c4e3b640fbe6be5;hpb=4b41feea830fc84e8c1b2fd0982f3e8d8840af96;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_saquit.cpp b/src/modules/m_saquit.cpp index b74660487..c3895ec12 100644 --- a/src/modules/m_saquit.cpp +++ b/src/modules/m_saquit.cpp @@ -21,8 +21,6 @@ #include "inspircd.h" -/* $ModDesc: Provides support for an SAQUIT command, exits user with a reason */ - /** Handle /SAQUIT */ class CommandSaquit : public Command @@ -31,17 +29,17 @@ class CommandSaquit : public Command CommandSaquit(Module* Creator) : Command(Creator, "SAQUIT", 2, 2) { flags_needed = 'o'; Penalty = 0; syntax = " "; - TRANSLATE3(TR_NICK, TR_TEXT, TR_END); + TRANSLATE2(TR_NICK, TR_TEXT); } CmdResult Handle (const std::vector& parameters, User *user) { User* dest = ServerInstance->FindNick(parameters[0]); - if ((dest) && (!IS_SERVER(dest))) + if ((dest) && (dest->registered == REG_ALL)) { - if (ServerInstance->ULine(dest->server)) + if (dest->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; } @@ -63,10 +61,7 @@ class CommandSaquit : 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]); } }; @@ -79,11 +74,6 @@ class ModuleSaquit : public Module { } - void init() CXX11_OVERRIDE - { - ServerInstance->Modules->AddService(cmd); - } - Version GetVersion() CXX11_OVERRIDE { return Version("Provides support for an SAQUIT command, exits user with a reason", VF_OPTCOMMON | VF_VENDOR); @@ -91,4 +81,3 @@ class ModuleSaquit : public Module }; MODULE_INIT(ModuleSaquit) -