]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_saquit.cpp
m_spanningtree Remove unneeded #includes
[user/henk/code/inspircd.git] / src / modules / m_saquit.cpp
index 46f047550377d73bfa2b507705657724c0b1bfd0..88b840b34fe86bca87ffbffccd6168825a96e337 100644 (file)
@@ -37,7 +37,7 @@ class CommandSaquit : public Command
        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]);
@@ -77,18 +77,18 @@ class ModuleSaquit : public Module
        ModuleSaquit()
                : cmd(this)
        {
-               ServerInstance->AddCommand(&cmd);
        }
 
-       virtual ~ModuleSaquit()
+       void init()
        {
+               ServerInstance->Modules->AddService(cmd);
        }
 
        virtual Version GetVersion()
        {
                return Version("Provides support for an SAQUIT command, exits user with a reason", VF_OPTCOMMON | VF_VENDOR);
        }
-
 };
 
 MODULE_INIT(ModuleSaquit)
+