From 9de86c34d41fcbcedf7b332746b7f0e8c37c7c45 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Wed, 3 Apr 2013 19:54:23 +0200 Subject: ListModeBase: Minor changes to original u_listmode code - Add constructors to ListItem, ListLimit - Rename fields in ListItem - Store time as time_t instead of string - Store limits in a vector instead of a list - Don't deallocate the list when it becomes empty --- include/listmode.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'include/listmode.h') diff --git a/include/listmode.h b/include/listmode.h index 40c28f67f..c21f9b93f 100644 --- a/include/listmode.h +++ b/include/listmode.h @@ -25,12 +25,13 @@ class ListModeBase : public ModeHandler public: /** An item in a listmode's list */ - class ListItem + struct ListItem { - public: - std::string nick; + std::string setter; std::string mask; - std::string time; + time_t time; + ListItem(const std::string& Mask, const std::string& Setter, time_t Time) + : setter(Setter), mask(Mask), time(Time) { } }; /** Items stored in the channel's list @@ -40,16 +41,16 @@ class ListModeBase : public ModeHandler private: /** The number of items a listmode's list may contain */ - class ListLimit + struct ListLimit { - public: std::string mask; unsigned int limit; + ListLimit(const std::string& Mask, unsigned int Limit) : mask(Mask), limit(Limit) { } }; /** Max items per channel by name */ - typedef std::list limitlist; + typedef std::vector limitlist; protected: /** Numeric to use when outputting the list -- cgit v1.2.3