]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/commands/cmd_list.cpp
Fix MySQL crash on module unload with empty query queue
[user/henk/code/inspircd.git] / src / commands / cmd_list.cpp
index 9d65b4165392fc9022fdf515e950d21d41396d17..b820135f87fcf99d6a9e503d85c708ffcfccedce 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 "commands/cmd_list.h"
 
-/** Handle /LIST
+/** Handle /LIST. These command handlers can be reloaded by the core,
+ * and handle basic RFC1459 commands. Commands within modules work
+ * the same way, however, they can be fully unloaded, where these
+ * may not.
  */
-extern "C" DllExport Command* init_command(InspIRCd* Instance)
+class CommandList : public Command
 {
-       return new CommandList(Instance);
-}
+ public:
+       /** Constructor for list.
+        */
+       CommandList ( Module* parent) : Command(parent,"LIST", 0, 0) { Penalty = 5; }
+       /** Handle command.
+        * @param parameters The parameters to the comamnd
+        * @param pcnt The number of parameters passed to teh command
+        * @param user The user issuing the command
+        * @return A value from CmdResult to indicate command success or failure.
+        */
+       CmdResult Handle(const std::vector<std::string>& parameters, User *user);
+};
+
 
+/** Handle /LIST
+ */
 CmdResult CommandList::Handle (const std::vector<std::string>& parameters, User *user)
 {
        int minusers = 0, maxusers = 0;
@@ -79,3 +94,5 @@ CmdResult CommandList::Handle (const std::vector<std::string>& parameters, User
        return CMD_SUCCESS;
 }
 
+
+COMMAND_INIT(CommandList)