]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_saquit.cpp
m_spanningtree Log nick collisions more verbosely and in all cases
[user/henk/code/inspircd.git] / src / modules / m_saquit.cpp
index 30bae5c0e42b10917a098205e37d306aefadef86..aa6aa01809f238bef392d11659576ca6b99c70fa 100644 (file)
@@ -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 = "<nick> <reason>";
-               TRANSLATE3(TR_NICK, TR_TEXT, TR_END);
+               TRANSLATE2(TR_NICK, TR_TEXT);
        }
 
        CmdResult Handle (const std::vector<std::string>& parameters, User *user)
        {
                User* dest = ServerInstance->FindNick(parameters[0]);
-               if ((dest) && (!IS_SERVER(dest)))
+               if ((dest) && (!IS_SERVER(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;
                        }
 
@@ -79,16 +77,10 @@ class ModuleSaquit : public Module
        {
        }
 
-       void init()
-       {
-               ServerInstance->Modules->AddService(cmd);
-       }
-
-       virtual Version GetVersion()
+       Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Provides support for an SAQUIT command, exits user with a reason", VF_OPTCOMMON | VF_VENDOR);
        }
 };
 
 MODULE_INIT(ModuleSaquit)
-