diff options
author | Peter Powell <petpow@saberuk.com> | 2019-06-12 18:41:48 +0100 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2019-06-12 18:43:00 +0100 |
commit | 938837af9fe92d0fef811db96a5e9d6bf8e3ae11 (patch) | |
tree | a3bb8943b99776ccf74e499087ab36c21cf75660 /src/modules | |
parent | 9b35c4c78cb15bdae0431f1425983bc41150fee5 (diff) |
chanhistory: recreate the mode parameter instead of saving it.
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_chanhistory.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/modules/m_chanhistory.cpp b/src/modules/m_chanhistory.cpp index 540fa2908..ed7bb684f 100644 --- a/src/modules/m_chanhistory.cpp +++ b/src/modules/m_chanhistory.cpp @@ -39,11 +39,14 @@ struct HistoryItem struct HistoryList { std::deque<HistoryItem> lines; - unsigned int maxlen, maxtime; - std::string param; + unsigned int maxlen; + unsigned int maxtime; - HistoryList(unsigned int len, unsigned int time, const std::string& oparam) - : maxlen(len), maxtime(time), param(oparam) { } + HistoryList(unsigned int len, unsigned int time) + : maxlen(len) + , maxtime(time) + { + } }; class HistoryMode : public ParamMode<HistoryMode, SimpleExtItem<HistoryList> > @@ -90,18 +93,19 @@ class HistoryMode : public ParamMode<HistoryMode, SimpleExtItem<HistoryList> > history->maxlen = len; history->maxtime = time; - history->param = parameter; } else { - ext.set(channel, new HistoryList(len, time, parameter)); + ext.set(channel, new HistoryList(len, time)); } return MODEACTION_ALLOW; } void SerializeParam(Channel* chan, const HistoryList* history, std::string& out) { - out.append(history->param); + out.append(ConvToStr(history->maxlen)); + out.append(":"); + out.append(InspIRCd::DurationString(history->maxtime)); } }; |