summaryrefslogtreecommitdiff
path: root/include/listmode.h
diff options
context:
space:
mode:
authorattilamolnar <attilamolnar@hush.com>2013-04-03 19:54:23 +0200
committerattilamolnar <attilamolnar@hush.com>2013-04-08 23:13:25 +0200
commit9de86c34d41fcbcedf7b332746b7f0e8c37c7c45 (patch)
treee05e4985f521f863b66991405c96f1b9d1d82dfa /include/listmode.h
parentebe5b201aab71cf2ead1e068889be736314fbb73 (diff)
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
Diffstat (limited to 'include/listmode.h')
-rw-r--r--include/listmode.h15
1 files changed, 8 insertions, 7 deletions
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<ListLimit> limitlist;
+ typedef std::vector<ListLimit> limitlist;
protected:
/** Numeric to use when outputting the list