]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/commands/cmd_clearcache.cpp
Fix typo in log message.
[user/henk/code/inspircd.git] / src / commands / cmd_clearcache.cpp
index 151587f12440be4c2e0aec45c31ecb75af403e1f..b47017c07bafc2d6754497e56b727183f72566ab 100644 (file)
@@ -1,23 +1,48 @@
-/*       +------------------------------------+
- *       | Inspire Internet Relay Chat Daemon |
- *       +------------------------------------+
+/*
+ * InspIRCd -- Internet Relay Chat Daemon
  *
- *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
- * See: http://wiki.inspircd.org/Credits
+ *   Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org>
+ *   Copyright (C) 2007 Robin Burchell <robin+git@viroteck.net>
  *
- * This program is free but copyrighted software; see
- *            the file COPYING for details.
+ * This file is part of InspIRCd.  InspIRCd is free software: you can
+ * redistribute it and/or modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation, version 2.
  *
- * ---------------------------------------------------
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+
 #include "inspircd.h"
-#include "commands/cmd_clearcache.h"
 
-extern "C" DllExport Command* init_command(InspIRCd* Instance)
+#include "users.h"
+#include "channels.h"
+#include "ctables.h"
+
+/** Handle /CLEARCACHE. 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.
+ */
+class CommandClearcache : public Command
 {
-       return new CommandClearcache(Instance);
-}
+ public:
+       /** Constructor for clearcache.
+        */
+       CommandClearcache ( Module* parent) : Command(parent,"CLEARCACHE",0) { flags_needed = 'o'; }
+       /** 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 /CLEARCACHE
  */
@@ -27,3 +52,5 @@ CmdResult CommandClearcache::Handle (const std::vector<std::string>& parameters,
        user->WriteServ("NOTICE %s :*** Cleared DNS cache of %d items.", user->nick.c_str(), n);
        return CMD_SUCCESS;
 }
+
+COMMAND_INIT(CommandClearcache)