- public:
- cmd_whowas () : command_t("WHOWAS",0,1) { syntax = "<nick>{,<nick>}"; }
- void Handle(const char** parameters, int pcnt, userrec *user);
+ private:
+ /** Primary container, links nicknames tracked by WHOWAS to a list of records
+ */
+ whowas_users whowas;
+
+ /** List of nicknames in the order they were inserted into the map
+ */
+ whowas_users_fifo whowas_fifo;
+
+ public:
+ /** Max number of WhoWas entries per user.
+ */
+ unsigned int GroupSize;
+
+ /** Max number of cumulative user-entries in WhoWas.
+ * When max reached and added to, push out oldest entry FIFO style.
+ */
+ unsigned int MaxGroups;
+
+ /** Max seconds a user is kept in WhoWas before being pruned.
+ */
+ unsigned int MaxKeep;
+
+ CommandWhowas(Module* parent);
+ /** 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);
+ void AddToWhoWas(User* user);
+ std::string GetStats();
+ void Prune();
+ void Maintain();
+ ~CommandWhowas();