]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_saquit.cpp
Replace hardcoded mode letters passed to IsModeSet() and GetModeParameter() with...
[user/henk/code/inspircd.git] / src / modules / m_saquit.cpp
index 46f047550377d73bfa2b507705657724c0b1bfd0..7a78cada1c63e87fb53f97464eee3d779f7f13a8 100644 (file)
@@ -31,13 +31,13 @@ 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)
+               if ((dest) && (!IS_SERVER(dest)))
                {
                        if (ServerInstance->ULine(dest->server))
                        {
@@ -48,7 +48,7 @@ class CommandSaquit : public Command
                        // Pass the command on, so the client's server can quit it properly.
                        if (!IS_LOCAL(dest))
                                return CMD_SUCCESS;
-                       
+
                        ServerInstance->SNO->WriteGlobalSno('a', user->nick+" used SAQUIT to make "+dest->nick+" quit with a reason of "+parameters[1]);
 
                        ServerInstance->Users->QuitUser(dest, parameters[1]);
@@ -56,7 +56,7 @@ class CommandSaquit : public Command
                }
                else
                {
-                       user->WriteServ("NOTICE %s :*** Invalid nickname '%s'", user->nick.c_str(), parameters[0].c_str());
+                       user->WriteNotice("*** Invalid nickname '" + parameters[0] + "'");
                        return CMD_FAILURE;
                }
        }
@@ -77,18 +77,18 @@ class ModuleSaquit : public Module
        ModuleSaquit()
                : cmd(this)
        {
-               ServerInstance->AddCommand(&cmd);
        }
 
-       virtual ~ModuleSaquit()
+       void init() CXX11_OVERRIDE
        {
+               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)
+