]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/commands/cmd_whowas.h
CommandParser::LoopCall() changes
[user/henk/code/inspircd.git] / include / commands / cmd_whowas.h
index 71c635b392e250cc9802e804eec92898b419b00c..7e1eeefc9384771f759524a8fdc804be6ea7af22 100644 (file)
@@ -1,49 +1,31 @@
-/*       +------------------------------------+
- *       | 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 Dennis Friis <peavey@inspircd.org>
+ *   Copyright (C) 2006 Craig Edwards <craigedwards@brainbox.cc>
  *
- * 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/>.
  */
 
-#ifndef __CMD_WHOWAS_H__
-#define __CMD_WHOWAS_H__
-#include "modules.h"
-
-struct WhowasRequest : public Request
-{
-       /* list of available internal commands */
-       enum Internals
-       {
-               WHOWAS_ADD = 1,
-               WHOWAS_STATS = 2,
-               WHOWAS_PRUNE = 3,
-               WHOWAS_MAINTAIN = 4
-       };
-
-       const Internals type;
-       std::string value;
-       User* user;
 
-       WhowasRequest(Module* src, Module* whowas, Internals Type) : Request(src, whowas, "WHOWAS"), type(Type)
-       {}
-};
+#pragma once
 
-/* Forward ref for timer */
-class WhoWasMaintainTimer;
+#include "modules.h"
 
 /* Forward ref for typedefs */
 class WhoWasGroup;
 
-/** Timer that is used to maintain the whowas list, called once an hour
- */
-extern WhoWasMaintainTimer* timer;
-
 /** A group of users related by nickname
  */
 typedef std::deque<WhoWasGroup*> whowas_set;
@@ -72,11 +54,20 @@ class CommandWhowas : public Command
         */
        whowas_users_fifo whowas_fifo;
 
-       /* String holding stats so it can be collected
+  public:
+       /** Max number of WhoWas entries per user.
+        */
+       int WhoWasGroupSize;
+
+       /** Max number of cumulative user-entries in WhoWas.
+        *  When max reached and added to, push out oldest entry FIFO style.
         */
-       std::string stats;
+       int WhoWasMaxGroups;
+
+       /** Max seconds a user is kept in WhoWas before being pruned.
+        */
+       int WhoWasMaxKeep;
 
-  public:
        CommandWhowas(Module* parent);
        /** Handle command.
         * @param parameters The parameters to the comamnd
@@ -123,15 +114,3 @@ class WhoWasGroup
         */
        ~WhoWasGroup();
 };
-
-class WhoWasMaintainTimer : public Timer
-{
-  public:
-       WhoWasMaintainTimer(long interval)
-       : Timer(interval, ServerInstance->Time(), true)
-       {
-       }
-       virtual void Tick(time_t TIME);
-};
-
-#endif