]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/commands/cmd_kline.cpp
Fix MySQL crash on module unload with empty query queue
[user/henk/code/inspircd.git] / src / commands / cmd_kline.cpp
index 79e2e7292e8e1364d9d3b7feb4aa33e69ab9251a..4c11765b20880adeaf3d2c03af31a002db6351e9 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2010 InspIRCd Development Team
  * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
 
 #include "inspircd.h"
 #include "xline.h"
-/*       +------------------------------------+
- *       | Inspire Internet Relay Chat Daemon |
- *       +------------------------------------+
- *
- *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
- * See: http://wiki.inspircd.org/Credits
- *
- * This program is free but copyrighted software; see
- *      the file COPYING for details.
- *
- * ---------------------------------------------------
- */
-
-#ifndef __CMD_KLINE_H__
-#define __CMD_KLINE_H__
-
-// include the common header files
-
-#include "users.h"
-#include "channels.h"
 
 /** Handle /KLINE. These command handlers can be reloaded by the core,
  * and handle basic RFC1459 commands. Commands within modules work
@@ -44,7 +24,7 @@ class CommandKline : public Command
  public:
        /** Constructor for kline.
         */
-       CommandKline (InspIRCd* Instance, Module* parent) : Command(Instance,parent,"KLINE","o",1,3,false,0) { syntax = "<ident@host> [<duration> :<reason>]"; }
+       CommandKline ( Module* parent) : Command(parent,"KLINE",1,3) { flags_needed = 'o'; Penalty = 0; syntax = "<ident@host> [<duration> :<reason>]"; }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
@@ -54,8 +34,6 @@ class CommandKline : public Command
        CmdResult Handle(const std::vector<std::string>& parameters, User *user);
 };
 
-#endif
-
 
 /** Handle /KLINE
  */
@@ -92,7 +70,7 @@ CmdResult CommandKline::Handle (const std::vector<std::string>& parameters, User
                }
 
                long duration = ServerInstance->Duration(parameters[1].c_str());
-               KLine* kl = new KLine(ServerInstance, ServerInstance->Time(), duration, user->nick.c_str(), parameters[2].c_str(), ih.first.c_str(), ih.second.c_str());
+               KLine* kl = new KLine(ServerInstance->Time(), duration, user->nick.c_str(), parameters[2].c_str(), ih.first.c_str(), ih.second.c_str());
                if (ServerInstance->XLines->AddLine(kl,user))
                {
                        if (!duration)
@@ -118,7 +96,7 @@ CmdResult CommandKline::Handle (const std::vector<std::string>& parameters, User
        {
                if (ServerInstance->XLines->DelLine(target.c_str(),"K",user))
                {
-                       ServerInstance->SNO->WriteToSnoMask('x',"%s Removed K-line on %s.",user->nick.c_str(),target.c_str());
+                       ServerInstance->SNO->WriteToSnoMask('x',"%s removed K-line on %s",user->nick.c_str(),target.c_str());
                }
                else
                {